Enum Assert.CmpObj

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String message
      Core part of the message when the relation fails.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CmpObj​(java.lang.String message)
      Creates a new CmpObj with the given fractin of message; also the implementation of method isValid(int) has to be provided hereafter.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean invokeCompareTo​(java.lang.Comparable<?> expected, java.lang.Object actual)
      Returns expected.compareTo(actual) if possible.
      (package private) abstract boolean isValid​(int flag3)
      Returns whether isValid method here.
      static Assert.CmpObj valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Assert.CmpObj[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • message

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

      • CmpObj

        private CmpObj​(java.lang.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​(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
      • 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​(java.lang.Comparable<?> expected,
                                        java.lang.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:
        java.lang.IllegalArgumentException -
        • if expected is not an instance of Comparable and in particular for expected == null,
        • if invoking expected.compareTo(actual) raises an exception.
        java.lang.IllegalStateException - if expected.compare(actual) is evaluated for actual == null without throwing an exception as specified for Comparable.compareTo(T).