Enum Condition

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Condition>

    public enum Condition
    extends java.lang.Enum<Condition>
    Types of supported filtering
    • Enum Constant Detail

      • EQUALS

        public static final Condition EQUALS
        EQUALS condition
      • NOT_EQUALS

        public static final Condition NOT_EQUALS
        Not equals condition
      • CONTAINS

        public static final Condition CONTAINS
        Contains operation. Case insensitive
      • EXISTS

        public static final Condition EXISTS
        Exists condition
      • IN

        public static final Condition IN
        IN condition. Accepts filter value as comma-separated list
      • EQUALS_ANY

        public static final Condition EQUALS_ANY
        IN condition. Accepts filter value as comma-separated list
      • HAS

        public static final Condition HAS
        HAS condition. Accepts filter value as comma-separated list. Returns 'TRUE' of all provided values exist in collection
        Applicable only for collections
      • ANY

        public static final Condition ANY
        Overlap condition between two arrays
      • GREATER_THAN

        public static final Condition GREATER_THAN
        Greater than condition
      • GREATER_THAN_OR_EQUALS

        public static final Condition GREATER_THAN_OR_EQUALS
        Greater than or Equals condition
      • LOWER_THAN

        public static final Condition LOWER_THAN
        Lower than condition
      • LOWER_THAN_OR_EQUALS

        public static final Condition LOWER_THAN_OR_EQUALS
        Lower than or Equals condition
      • BETWEEN

        public static final Condition BETWEEN
        Between condition. Include boundaries
    • Field Detail

      • VALUES_SEPARATOR

        public static final java.lang.String VALUES_SEPARATOR
        See Also:
        Constant Field Values
      • TIMESTAMP_SEPARATOR

        public static final java.lang.String TIMESTAMP_SEPARATOR
        See Also:
        Constant Field Values
      • BETWEEN_FILTER_VALUES_COUNT

        public static final java.lang.Integer BETWEEN_FILTER_VALUES_COUNT
      • ZERO_TIMESTAMP_INDEX

        public static final java.lang.Integer ZERO_TIMESTAMP_INDEX
      • FIRST_TIMESTAMP_INDEX

        public static final java.lang.Integer FIRST_TIMESTAMP_INDEX
      • ZONE_OFFSET_INDEX

        public static final java.lang.Integer ZONE_OFFSET_INDEX
    • Method Detail

      • values

        public static Condition[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Condition c : Condition.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Condition valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • validate

        public abstract void validate​(CriteriaHolder criteriaHolder,
                                      java.lang.String value,
                                      boolean isNegative,
                                      com.epam.ta.reportportal.ws.model.ErrorType errorType)
        Validate condition value. This method should be overridden in all conditions which contains validations
        Parameters:
        criteriaHolder - Criteria description
        value - Value to be casted
        isNegative - Whether filter is negative
      • castValue

        public abstract java.lang.Object castValue​(CriteriaHolder criteriaHolder,
                                                   java.lang.String values,
                                                   com.epam.ta.reportportal.ws.model.ErrorType errorType)
        Cast filter values according condition.
        Parameters:
        criteriaHolder - Criteria description
        values - Value to be casted
        Returns:
        Casted value
      • getMarker

        public java.lang.String getMarker()
      • findByMarker

        public static java.util.Optional<Condition> findByMarker​(java.lang.String marker)
        Finds condition by marker. If there is no condition with specified marker returns NULL
        Parameters:
        marker - Marker to be checked
        Returns:
        Condition if found or NULL
      • isNegative

        public static boolean isNegative​(java.lang.String marker)
        Check whether condition is negative
        Parameters:
        marker - Marker to check
        Returns:
        TRUE of negative
      • makeNegative

        public static java.lang.String makeNegative​(boolean negative,
                                                    java.lang.String marker)
        Makes filter marker negative
        Parameters:
        negative - Whether condition is negative
        marker - Marker to check
        Returns:
        TRUE of negative
      • castArray

        public java.lang.Object[] castArray​(CriteriaHolder criteriaHolder,
                                            java.lang.String value,
                                            com.epam.ta.reportportal.ws.model.ErrorType errorType)
        Cast values for filters which have many values(filters with conditions:btw, in, etc)
        Parameters:
        criteriaHolder - Criteria description
        value - Value to be casted
        Returns:
        Casted value