Package org.intermine.template
Class TemplateValue
- java.lang.Object
-
- org.intermine.template.TemplateValue
-
public class TemplateValue extends java.lang.Object
A TemplateValue represents the value for an editable constraint of a template query and details about what is being constrained.- Author:
- Richard Smith
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TemplateValue.ValueType
Possible values for TemplateValue type.
-
Constructor Summary
Constructors Constructor Description TemplateValue(PathConstraint constraint, ConstraintOp op, java.lang.String value, TemplateValue.ValueType valueType, java.lang.String extraValue, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and the value.TemplateValue(PathConstraint constraint, ConstraintOp op, java.lang.String value, TemplateValue.ValueType valueType, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and the value.TemplateValue(PathConstraint constraint, ConstraintOp op, TemplateValue.ValueType valueType, java.util.List<java.lang.String> values, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and values.TemplateValue(PathConstraint constraint, ConstraintOp op, TemplateValue.ValueType valueType, SwitchOffAbility switchOffAbility)
Constructor.Construct with details of what we are constraining, but without the value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathConstraint
getConstraint()
Returns the constraint that this object was constructed with.java.lang.String
getExtraValue()
ConstraintOp
getOperation()
SwitchOffAbility
getSwitchOffAbility()
Returns the SwitchOffAbility.java.lang.String
getValue()
Returns value.java.util.List<java.lang.String>
getValues()
boolean
isBagConstraint()
Return true if this constraint value is a bag.boolean
isMultipleValue()
boolean
isObjectConstraint()
Return true if this constraint value is on InterMineObjectjava.lang.String
toString()
-
-
-
Constructor Detail
-
TemplateValue
public TemplateValue(PathConstraint constraint, ConstraintOp op, TemplateValue.ValueType valueType, SwitchOffAbility switchOffAbility)
Constructor.Construct with details of what we are constraining, but without the value.- Parameters:
constraint
- The constraint this value refers to.op
- The operation this constraint should have.valueType
- One of SIMPLE_VALUE, BAG_VALUE, or OBJECT_VALUE.switchOffAbility
- One of LOCKED, ON, OFF.
-
TemplateValue
public TemplateValue(PathConstraint constraint, ConstraintOp op, java.lang.String value, TemplateValue.ValueType valueType, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and the value. The value may be a user entered text, a bag name or an InterMineObject. The extraValue is only included for some constraint types.- Parameters:
constraint
- the constraintop
- constraint operationvalue
- value of the constraintvalueType
- the type of this constraint: simple value, bag or objectswitchOffAbility
- the required/optional status of the constraint
-
TemplateValue
public TemplateValue(PathConstraint constraint, ConstraintOp op, java.lang.String value, TemplateValue.ValueType valueType, java.lang.String extraValue, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and the value. The value may be a user entered text, a bag name or an InterMineObject. The extraValue is only included for some constraint types.- Parameters:
constraint
- the constraintop
- constraint operationvalue
- value of the constraintvalueType
- the type of this constraint: simple value, bag or objectextraValue
- extra valueswitchOffAbility
- the required/optional status of the constraint
-
TemplateValue
public TemplateValue(PathConstraint constraint, ConstraintOp op, TemplateValue.ValueType valueType, java.util.List<java.lang.String> values, SwitchOffAbility switchOffAbility)
Construct with the details of what we are constraining and values. The value may be a user entered text, a bag name or an InterMineObject. The extraValue is only included for some constraint types.- Parameters:
constraint
- the constraintop
- constraint operationvalues
- Multiple valuesvalueType
- the type of this constraint: simple value, bag or objectswitchOffAbility
- the required/optional status of the constraint
-
-
Method Detail
-
getExtraValue
public java.lang.String getExtraValue()
- Returns:
- extra value
-
isMultipleValue
public boolean isMultipleValue()
- Returns:
- Whether this represents a new multi-value template parameter
-
getValues
public java.util.List<java.lang.String> getValues()
- Returns:
- multiple values
-
getOperation
public ConstraintOp getOperation()
- Returns:
- operation
-
getValue
public java.lang.String getValue()
Returns value.- Returns:
- value
-
isBagConstraint
public boolean isBagConstraint()
Return true if this constraint value is a bag.- Returns:
- true if constraint value is a bag
-
isObjectConstraint
public boolean isObjectConstraint()
Return true if this constraint value is on InterMineObject- Returns:
- true if constraint value is an InterMineObject
-
getConstraint
public PathConstraint getConstraint()
Returns the constraint that this object was constructed with.- Returns:
- a PathConstraint object
-
getSwitchOffAbility
public SwitchOffAbility getSwitchOffAbility()
Returns the SwitchOffAbility.- Returns:
- the SwitchOffAbility
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-