Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 represented
        code - the code of this constraint in the query
        editableInTemplate - true if the query is a template and this is an editable constraint
        description - the description
        switchable - 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