Enum Assert.CmpObj

    • Field Detail

      • message

        private String message
        Core part of the message when the relation fails.
    • Constructor Detail

      • CmpObj

        private CmpObj​(String message)
        Creates a new CmpObj with the given fractin of message; also the implementation of method isValid(int) has to be provided hereafter.
        Parameters:
        message - a String value
    • Method Detail

      • values

        public static Assert.CmpObj[] 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 (Assert.CmpObj c : Assert.CmpObj.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Assert.CmpObj valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isValid

        abstract boolean isValid​(int flag3)
        Returns whether isValid method here.
        Parameters:
        flag3 - an int which is the output of a method Comparable.compareTo(T) or Comparator.compare(T, T).
        Returns:
        a boolean value signifying whether flag3 is allowed.
      • invokeCompareTo

        private boolean invokeCompareTo​(Comparable<?> expected,
                                        Object actual)
        Returns expected.compareTo(actual) if possible.
        Parameters:
        expected - an instance of an Object.
        actual - an Object or null.
        Returns:
        the int value which results in invoking expected.compare(actual).
        Throws:
        IllegalArgumentException -
        • if expected is not an instance of Comparable and in particular for expected == null,
        • if invoking expected.compareTo(actual) raises an exception.
        IllegalStateException - if expected.compare(actual) is evaluated for actual == null without throwing an exception as specified for Comparable.compareTo(T).