APIdia Launch Partner
Top Description Inners Methods
jdk.jpackage.internal.cli

public sealed Interface OptionValue<T>

extends WithOptionIdentifier
permits OptionValue.Internal.Standard<T>, OptionValue.Internal.Mapping<T, U>
Known Direct Implementers
jdk.jpackage.internal.cli.OptionValue.Internal.Standard, jdk.jpackage.internal.cli.OptionValue.Internal.Mapping
Type Parameters
<T>
option value type.
Imports
java.util.Objects, .Optional, java.util.function.Consumer, .Function

Typed getter of option values in Options objects.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Method Summary

Modifier and TypeMethod and Description
public Optional<Option>
public static <U> OptionValue.Builder<U>
public default boolean
public static <U> OptionValue<U>
public static <U> OptionValue<U>
public default Optional<T>
findIn(Options cmdline)

public default T
getFrom(Options cmdline)

public default String
public default Option
public default OptionSpec<T>
public default void
ifPresentIn(Options cmdline, Consumer<T> consumer)

Inherited from jdk.jpackage.internal.cli.WithOptionIdentifier:
idstub

Method Detail

asOptionback to summary
public Optional<Option> asOption()
buildback to summary
public static <U> OptionValue.Builder<U> build()
containsInback to summary
public default boolean containsIn(Options cmdline)
createback to summary
public static <U> OptionValue<U> create()
createback to summary
public static <U> OptionValue<U> create(OptionIdentifier id)
findInback to summary
public default Optional<T> findIn(Options cmdline)
Annotations
@SuppressWarnings:unchecked
getFromback to summary
public default T getFrom(Options cmdline)
getNameback to summary
public default String getName()
getOptionback to summary
public default Option getOption()
getSpecback to summary
public default OptionSpec<T> getSpec()
Annotations
@SuppressWarnings:unchecked
ifPresentInback to summary
public default void ifPresentIn(Options cmdline, Consumer<T> consumer)
jdk.jpackage.internal.cli back to summary

public final Class OptionValue.Builder<T>

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private OptionValue.Builder.Conv<?, T>
private T
private OptionIdentifier
private OptionSpec<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public OptionValue<T>
public OptionValue.Builder<T>
public <U> OptionValue.Builder<T>
from(OptionValue<U> base, Function<U, T> conv)

public OptionValue.Builder<T>
pack-priv OptionValue.Builder<T>
public <U> OptionValue.Builder<U>
to(Function<T, U> conv)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

convback to summary
private OptionValue.Builder.Conv<?, T> conv
defaultValueback to summary
private T defaultValue
idback to summary
private OptionIdentifier id
specback to summary
private OptionSpec<?> spec

Constructor Detail

Builderback to summary
public Builder()

Method Detail

createback to summary
public OptionValue<T> create()
defaultValueback to summary
public OptionValue.Builder<T> defaultValue(T v)
fromback to summary
public <U> OptionValue.Builder<T> from(OptionValue<U> base, Function<U, T> conv)
idback to summary
public OptionValue.Builder<T> id(OptionIdentifier v)
specback to summary
pack-priv OptionValue.Builder<T> spec(OptionSpec<?> v)
toback to summary
public <U> OptionValue.Builder<U> to(Function<T, U> conv)
jdk.jpackage.internal.cli back to summary

private final Record OptionValue.Builder.Conv<U, V>

extends Record
Class Inheritance
Record Components
base:OptionValue<U> 
conv:Function<U, V> 

Field Summary

Modifier and TypeField and Description
private final OptionValue<U>
base

Record Component accessed by base().

private final Function<U, V>
conv

Record Component accessed by conv().

Constructor Summary

AccessConstructor and Description
pack-priv
Conv(OptionValue<U> base, Function<U, V> conv)

Method Summary

Modifier and TypeMethod and Description
public OptionValue<U>
base()

Record Component getter of base.

public Function<U, V>
conv()

Record Component getter of conv.

pack-priv OptionValue<V>
create(Optional<V> defaultValue)

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

baseback to summary
private final OptionValue<U> base

Record Component accessed by base().

convback to summary
private final Function<U, V> conv

Record Component accessed by conv().

Constructor Detail

Convback to summary
pack-priv Conv(OptionValue<U> base, Function<U, V> conv)

Method Detail

baseback to summary
public OptionValue<U> base()

Record Component getter of base.

convback to summary
public Function<U, V> conv()

Record Component getter of conv.

createback to summary
pack-priv OptionValue<V> create(Optional<V> defaultValue)
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.cli back to summary

public final Class OptionValue.Internal

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static record

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Internalback to summary
private Internal()
jdk.jpackage.internal.cli back to summary

private final Record OptionValue.Internal.Mapping<T, U>

extends Record
implements OptionValue<T>
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.cli.OptionValue, jdk.jpackage.internal.cli.WithOptionIdentifier
Record Components
base:OptionValue<U> 
conv:Function<U, T> 
defaultValue:Optional<T> 

Field Summary

Modifier and TypeField and Description
private final OptionValue<U>
base

Record Component accessed by base().

private final Function<U, T>
conv

Record Component accessed by conv().

private final Optional<T>
defaultValue

Record Component accessed by defaultValue().

Constructor Summary

AccessConstructor and Description
pack-priv
Mapping(OptionValue<U> base, Function<U, T> conv, Optional<T> defaultValue)

Method Summary

Modifier and TypeMethod and Description
public Optional<Option>
public OptionValue<U>
base()

Record Component getter of base.

public Function<U, T>
conv()

Record Component getter of conv.

public Optional<T>
defaultValue()

Record Component getter of defaultValue.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Optional<T>
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public OptionIdentifier
public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

baseback to summary
private final OptionValue<U> base

Record Component accessed by base().

convback to summary
private final Function<U, T> conv

Record Component accessed by conv().

defaultValueback to summary
private final Optional<T> defaultValue

Record Component accessed by defaultValue().

Constructor Detail

Mappingback to summary
pack-priv Mapping(OptionValue<U> base, Function<U, T> conv, Optional<T> defaultValue)

Method Detail

asOptionback to summary
public Optional<Option> asOption()

Implements jdk.jpackage.internal.cli.OptionValue.asOption.

Annotations
@Override
baseback to summary
public OptionValue<U> base()

Record Component getter of base.

convback to summary
public Function<U, T> conv()

Record Component getter of conv.

defaultValueback to summary
public Optional<T> defaultValue()

Record Component getter of defaultValue.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
findInback to summary
public Optional<T> findIn(Options cmdline)

Overrides default jdk.jpackage.internal.cli.OptionValue.findIn.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

idback to summary
public OptionIdentifier id()

Implements jdk.jpackage.internal.cli.WithOptionIdentifier.id.

Annotations
@Override
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.cli back to summary

private final Record OptionValue.Internal.Standard<T>

extends Record
implements OptionValue<T>
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.cli.OptionValue, jdk.jpackage.internal.cli.WithOptionIdentifier
Record Components
id:OptionIdentifier 
spec:Optional<OptionSpec<?>> 
defaultValue:Optional<T> 

Field Summary

Modifier and TypeField and Description
private final Optional<T>
defaultValue

Record Component accessed by defaultValue().

private final OptionIdentifier
id

Record Component accessed by id().

private final Optional<OptionSpec<?>>
spec

Record Component accessed by spec().

Constructor Summary

AccessConstructor and Description
pack-priv
Standard(OptionIdentifier id, Optional<OptionSpec<?>> spec, Optional<T> defaultValue)

Method Summary

Modifier and TypeMethod and Description
public Optional<Option>
public Optional<T>
defaultValue()

Record Component getter of defaultValue.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Optional<T>
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public OptionIdentifier
id()

Record Component getter of id.

Implements jdk.jpackage.internal.cli.WithOptionIdentifier.id.

public Optional<OptionSpec<?>>
spec()

Record Component getter of spec.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

defaultValueback to summary
private final Optional<T> defaultValue

Record Component accessed by defaultValue().

idback to summary
private final OptionIdentifier id

Record Component accessed by id().

specback to summary
private final Optional<OptionSpec<?>> spec

Record Component accessed by spec().

Constructor Detail

Standardback to summary
pack-priv Standard(OptionIdentifier id, Optional<OptionSpec<?>> spec, Optional<T> defaultValue)

Method Detail

asOptionback to summary
public Optional<Option> asOption()

Implements jdk.jpackage.internal.cli.OptionValue.asOption.

Annotations
@Override
defaultValueback to summary
public Optional<T> defaultValue()

Record Component getter of defaultValue.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
findInback to summary
public Optional<T> findIn(Options cmdline)

Overrides default jdk.jpackage.internal.cli.OptionValue.findIn.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

idback to summary
public OptionIdentifier id()

Record Component getter of id.

Implements jdk.jpackage.internal.cli.WithOptionIdentifier.id.

specback to summary
public Optional<OptionSpec<?>> spec()

Record Component getter of spec.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.