Enum Class ValidationElement

java.lang.Object
java.lang.Enum<ValidationElement>
net.time4j.engine.ValidationElement
All Implemented Interfaces:
Serializable, Comparable<ValidationElement>, java.lang.constant.Constable, Comparator<ChronoDisplay>, ChronoElement<String>

public enum ValidationElement extends Enum<ValidationElement> implements ChronoElement<String>

A specialized element for communicating validation failures during parsing.

Since:
2.2
Author:
Meno Hochschild
See Also:
ChronoMerger
  • Enum Constant Details

    • ERROR_MESSAGE

      public static final ValidationElement ERROR_MESSAGE

      Identifies an error message in any parsed chronological entity.

  • Method Details

    • values

      public static ValidationElement[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ValidationElement valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getType

      public Class<String> getType()
      Description copied from interface: ChronoElement

      Yields the reified value type.

      Specified by:
      getType in interface ChronoElement<String>
      Returns:
      type of associated values
    • getSymbol

      public char getSymbol()
      Description copied from interface: ChronoElement

      Defines the default format symbol which is used in format patterns to refer to this element.

      In most cases the symbol should closely match the symbol-mapping as defined by the CLDR-standard of unicode-organization. Is the element not designed for formatting using patterns then this method just yields the ASCII-char "" (Codepoint 0).

      Specified by:
      getSymbol in interface ChronoElement<String>
      Returns:
      format symbol as char
      See Also:
      FormattableElement
    • compare

      public int compare(ChronoDisplay o1, ChronoDisplay o2)
      Description copied from interface: ChronoElement

      Applies an element-orientated sorting of any chronological entities.

      The value type V is usually a subtype of the interface Comparable so that this method will usually be based on the expression o1.get(this).compareTo(o2.get(this)). In other words, this method compares the element values of given chronological entities. It is even permitted to compare entities of different chronological types as long as the entities both support this element.

      It should be noted however that a element value comparison does often not induce any temporal (complete) order. Counter examples are the year of gregorian BC-era (reversed temporal order before Jesu birth) or the clock display of hours (12 is indeed the begin at midnight).

      Specified by:
      compare in interface ChronoElement<String>
      Specified by:
      compare in interface Comparator<ChronoDisplay>
      Parameters:
      o1 - the first object to be compared
      o2 - the second object to be compared
      Returns:
      a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
    • getDefaultMinimum

      public String getDefaultMinimum()
      Description copied from interface: ChronoElement

      Returns the default minimum of this element which is not dependent on the chronological context.

      Note: This minimum does not necessarily define a minimum for all possible circumstances but only the default minimum under normal conditions such that the default minimum always exists and can be used as prototypical value. An example is the start of day which is usually midnight in ISO-8601 and can only deviate in specialized timezone context.

      Specified by:
      getDefaultMinimum in interface ChronoElement<String>
      Returns:
      default minimum value of element
      See Also:
      ChronoElement.getDefaultMaximum()
    • getDefaultMaximum

      public String getDefaultMaximum()
      Description copied from interface: ChronoElement

      Returns the default maximum of this element which is not dependent on the chronological context.

      Note: This maximum does not necessarily define a maximum for all possible circumstances but only the default maximum under normal conditions. An example is the second of minute whose default maximum is 59 while the largest maximum can be 60 in context of UTC-leapseconds.

      Specified by:
      getDefaultMaximum in interface ChronoElement<String>
      Returns:
      default maximum value of element
      See Also:
      ChronoElement.getDefaultMinimum()
    • isDateElement

      public boolean isDateElement()
      Description copied from interface: ChronoElement

      Queries if this element represents a calendar date element.

      Specified by:
      isDateElement in interface ChronoElement<String>
      Returns:
      boolean
      See Also:
      ChronoElement.isTimeElement()
    • isTimeElement

      public boolean isTimeElement()
      Description copied from interface: ChronoElement

      Queries if this element represents a wall time element.

      Specified by:
      isTimeElement in interface ChronoElement<String>
      Returns:
      boolean
      See Also:
      ChronoElement.isDateElement()
    • isLenient

      public boolean isLenient()
      Description copied from interface: ChronoElement

      Queries if setting of element values is performed in a lenient way.

      Specified by:
      isLenient in interface ChronoElement<String>
      Returns:
      true if lenient else false (standard)
      See Also:
      ElementRule.withValue(T, V, boolean)