Class NullValue


  • public final class NullValue
    extends Value
    Defines the null value. The null value is instance of AnyType.
    Author:
    Holger Eichelberger
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  NullValue.NullValueType
      Defines the type of the singleton null value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Value INSTANCE
      The only instance of the null value.
      static java.lang.Object VALUE
      The value to be returned by getValue().
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NullValue()
      Creates a null value.
    • Field Detail

      • INSTANCE

        public static final Value INSTANCE
        The only instance of the null value.
      • VALUE

        public static final java.lang.Object VALUE
        The value to be returned by getValue(). null would be an alternative but this may break existing code.
    • Constructor Detail

      • NullValue

        private NullValue()
        Creates a null value. Not visible due to singlton constant character.
    • Method Detail

      • getValue

        public java.lang.Object getValue()
        Description copied from class: Value
        Abstract getValue method. The result of this method must comply to the input conventions of ValueFactory and the constructor of the respective implementing class.
        Specified by:
        getValue in class Value
        Returns:
        the Value of the Datatype
      • accept

        public void accept​(IValueVisitor visitor)
        Description copied from class: Value
        Abstract accept method.
        Specified by:
        accept in class Value
        Parameters:
        visitor - The visitor
      • isConfigured

        public boolean isConfigured()
        Description copied from class: Value
        Abstract Method to check whether a value is configured.
        Specified by:
        isConfigured in class Value
        Returns:
        true = it is configured / false = it is not
      • clone

        public Value clone()
        Description copied from class: Value
        Clones the this value.
        Overrides:
        clone in class Value
        Returns:
        the clone of the value
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Value
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class Value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Value
      • equalsPartially

        public boolean equalsPartially​(Value value)
        Description copied from class: Value
        Returns whether the provided value is partially equal to this value, i.e., whether the nested elements of value (if they exist) have the same contents as in this value. Other values of this value are not considered. The check is transitive on nested elements. Please consider that this method is not symmetric as opposed to equals. This method is important to cope with default values.
        Specified by:
        equalsPartially in class Value
        Parameters:
        value - the value to be checked for partial equality.
        Returns:
        true if value is partially equal to this, false else