Interface Options


public sealed interface Options
R/O collection of objects associated with option identifiers.

Use OptionValue for typed access of the stored objects.

  • Method Details

    • find

    • contains

      boolean contains(jdk.jpackage.internal.cli.OptionName optionName)
    • ids

      Set<? extends OptionIdentifier> ids()
    • find

      default Optional<Object> find(WithOptionIdentifier withId)
    • contains

      default boolean contains(OptionIdentifier id)
    • contains

      default boolean contains(WithOptionIdentifier withId)
    • copyWithDefaultValue

      default Options copyWithDefaultValue(WithOptionIdentifier withId, Object value)
    • copyWithDefaultValue

      default Options copyWithDefaultValue(WithOptionIdentifier withId, Supplier<Object> valueSupplier)
    • copyWithParent

      default Options copyWithParent(Options other)
    • copyWithout

      default Options copyWithout(OptionIdentifier... ids)
      Creates a copy of this instance without the given option identifiers.

      contains(OptionIdentifier) called on the return instance with any of the given identifiers will return false. contains(OptionName) called on the return instance with any option name of option specifications associated with given identifiers will return false.

      Parameters:
      ids - the identifiers to exclude
      Returns:
      a copy of this instance without the given option identifiers
    • copyWithout

      Options copyWithout(Iterable<? extends OptionIdentifier> ids)
      Creates a copy of this instance without the given option identifiers.

      Same as copyWithout(OptionIdentifier...) but takes an Iterable<OptionIdentifier> instead of an OptionIdentifier[].

      Parameters:
      ids - the identifiers to exclude
      Returns:
      a copy of this instance without the given option identifiers
    • copyWith

      default Options copyWith(OptionIdentifier... ids)
      Creates a copy of this instance with all but the given option identifiers filtered out.

      contains(OptionIdentifier) called on the returned instance with any identifiers not in the given array will return false. contains(OptionName) called on the returned instance with any name returned by OptionSpec.name() method called on option specifications of identifiers of type Option not from the given identifier array will return false.

      Parameters:
      ids - the identifiers to keep in the copy
      Returns:
      a copy of this instance with all but the given option identifiers filtered out
    • copyWith

      default Options copyWith(Iterable<? extends OptionIdentifier> ids)
      Creates a copy of this instance with all but the given option identifiers filtered out.

      Same as copyWith(OptionIdentifier...) but takes an Iterable<OptionIdentifier> instead of an OptionIdentifier[].

      Parameters:
      ids - the identifiers to keep in the copy
      Returns:
      a copy of this instance with all but the given option identifiers filtered out
    • toMap

      default Map<OptionIdentifier,Object> toMap()
      Returns a map representation of this instance.
      Returns:
      the map representation of this instance.
    • of

      static Options of(Map<? extends WithOptionIdentifier,Object> map)
      Creates Options instance from the map of objects with option identifiers and associated option values.
      Parameters:
      map - the map of objects with option identifiers and associated option values
      Returns:
      a new Options instance
    • ofIDs

      static Options ofIDs(Map<OptionIdentifier,Object> map)
      Creates Options instance from the map of option identifiers and associated option values.

      Similar to of(Map) method, but contains(OptionName) called on the return instance will always return false.

      Parameters:
      map - the map of option identifiers and associated option values
      Returns:
      a new Options instance
    • concat

      static Options concat(Options... options)