Class SummaryConstraint
- java.lang.Object
-
- org.intermine.web.logic.querybuilder.SummaryConstraint
-
public class SummaryConstraint extends java.lang.Object
Representation of a PathQuery constraint with additional information for display in the QueryBuilder summary section. Holds the constraint code in the query and, if the query is a template, whether the constraint is editable.- Author:
- Richard Smith
-
-
Constructor Summary
Constructors Constructor Description SummaryConstraint(PathConstraint con, java.lang.String code, boolean editableInTemplate, java.lang.String description, java.lang.String switchable)
Construct with the underlying PathConstraint and additional details from the PathQuery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCode()
Get the code associated with this constraint in the query.java.lang.String
getDescription()
Get the description for a constraint.java.lang.String
getOp()
Get a string representation of the constraint operation.java.lang.String
getSwitchable()
Get the switchoffAbility for a constraint.java.lang.String
getValue()
Get a string representation of the constraint value to be displayed.boolean
isEditableInTemplate()
Returns true if the constraint is part of a template query and the constraint is editable in that template.boolean
isValidEditableConstraintType()
Return true if this type of constraint can be set as editable in a template query - i.e.
-
-
-
Constructor Detail
-
SummaryConstraint
public SummaryConstraint(PathConstraint con, java.lang.String code, boolean editableInTemplate, java.lang.String description, java.lang.String switchable)
Construct with the underlying PathConstraint and additional details from the PathQuery.- Parameters:
con
- the constraint representedcode
- the code of this constraint in the queryeditableInTemplate
- true if the query is a template and this is an editable constraintdescription
- the descriptionswitchable
- the switchOffAbility
-
-
Method Detail
-
getOp
public java.lang.String getOp()
Get a string representation of the constraint operation.- Returns:
- the constraint op
-
getCode
public java.lang.String getCode()
Get the code associated with this constraint in the query.- Returns:
- the constraint code
-
getValue
public java.lang.String getValue()
Get a string representation of the constraint value to be displayed. If this is null or not null constraint this returns null as the operation is the same as the value. For LOOKUP constraints the string will include the extra value if present.- Returns:
- a representation of the constraint value
-
isEditableInTemplate
public boolean isEditableInTemplate()
Returns true if the constraint is part of a template query and the constraint is editable in that template. Determines status of the 'lock' icon on template constraints.- Returns:
- true if this is a template editable constraint
-
isValidEditableConstraintType
public boolean isValidEditableConstraintType()
Return true if this type of constraint can be set as editable in a template query - i.e. if it is an attribute or lookup constraint or null constraint.- Returns:
- true if can be set as an editable constraint
-
getDescription
public java.lang.String getDescription()
Get the description for a constraint.- Returns:
- a description
-
getSwitchable
public java.lang.String getSwitchable()
Get the switchoffAbility for a constraint.- Returns:
- the switchoffAbility
-
-