Class 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
    • 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 constraint
        op - constraint operation
        value - value of the constraint
        valueType - the type of this constraint: simple value, bag or object
        switchOffAbility - 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 constraint
        op - constraint operation
        value - value of the constraint
        valueType - the type of this constraint: simple value, bag or object
        extraValue - extra value
        switchOffAbility - 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 constraint
        op - constraint operation
        values - Multiple values
        valueType - the type of this constraint: simple value, bag or object
        switchOffAbility - 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 class java.lang.Object