Class PropertyType.PropertyValue<T>

java.lang.Object
org.ec4j.core.model.PropertyType.PropertyValue<T>
Type Parameters:
T - the type of the parsed parsed
Enclosing class:
PropertyType<T>

public static class PropertyType.PropertyValue<T> extends Object
The result of Property parsed parsing. The result may either be valid when it has parsed or invalid when it has no parsed, but it has an errorMessage.
  • Field Details

    • UNSET

      private static final PropertyType.PropertyValue UNSET
      A singleton with the special unset source value
    • errorMessage

      private final String errorMessage
    • parsed

      private final T parsed
    • source

      private final String source
  • Constructor Details

    • PropertyValue

      PropertyValue(String source, T value, String errorMessage)
  • Method Details

    • invalid

      public static <T> PropertyType.PropertyValue<T> invalid(String source, String errorMessage)
    • valid

      public static <T> PropertyType.PropertyValue<T> valid(String source, T value)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getErrorMessage

      public String getErrorMessage()
      Returns:
      the error message describing why the parsing failed or null if the parsing succeeded
    • getParsed

      public T getParsed()
      Returns:
      the parsed parsed or null if the parsing failed.
    • getSource

      public String getSource()
      Returns:
      the string from which this PropertyType.PropertyValue was created
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isUnset

      public boolean isUnset()
      Returns:
      true if the source value is "unset"; otherwise false
    • isValid

      public boolean isValid()
      Returns:
      true if the parsing succeeded or false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object