Record Class SubOption

java.lang.Object
java.lang.Record
ecmwf.common.ectrans.SubOption
Record Components:
name - the key as expected inside the options string (e.g. "pattern", "standby")
clazz - the expected type of the value (Boolean, Integer, Long, String, Duration, etc.)
choices - the list of accepted values if the value is restricted to a fixed set (empty if free-form)

public record SubOption(String name, Class<?> clazz, List<String> choices) extends Record
Describes one of the key=value entries that can appear inside the string returned by Options when parsing the value of an ECtransOptions constant whose type is a nested options string (e.g. scheduler.force="pattern=.*;standby=yes").

This is purely descriptive metadata used for documentation and validation purposes (e.g. by the Properties editor in the web UI, or by future documentation generators). It has no effect on the actual runtime parsing, which is entirely handled by Options.

  • Constructor Details

    • SubOption

      public SubOption(String name, Class<?> clazz)
      Instantiates a new sub option with no restricted set of choices.
      Parameters:
      name - the key as expected inside the options string
      clazz - the expected type of the value
    • SubOption

      public SubOption(String name, Class<?> clazz, List<String> choices)
      Creates an instance of a SubOption record class.
      Parameters:
      name - the value for the name record component
      clazz - the value for the clazz record component
      choices - the value for the choices record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • clazz

      public Class<?> clazz()
      Returns the value of the clazz record component.
      Returns:
      the value of the clazz record component
    • choices

      public List<String> choices()
      Returns the value of the choices record component.
      Returns:
      the value of the choices record component