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

pack-priv final Class HelpFormatter

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collection, .List, .Objects, .Optional, java.util.function.Consumer, java.util.stream.Collectors, .Stream

Generic help formatter.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static record
pack-priv static record
pack-priv static interface
pack-priv static record
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private final HelpFormatter.OptionGroupFormatter
private final List<HelpFormatter.OptionGroup>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static HelpFormatter.Builder
pack-priv static Consumer<CharSequence>
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatterback to summary
private final HelpFormatter.OptionGroupFormatter formatter
optionGroupsback to summary
private final List<HelpFormatter.OptionGroup> optionGroups

Constructor Detail

HelpFormatterback to summary
private HelpFormatter(List<HelpFormatter.OptionGroup> optionGroups, HelpFormatter.OptionGroupFormatter formatter)

Method Detail

buildback to summary
pack-priv static HelpFormatter.Builder build()
eolback to summary
pack-priv static Consumer<CharSequence> eol(Consumer<CharSequence> sink)
formatback to summary
pack-priv void format(Consumer<CharSequence> sink)
jdk.jpackage.internal.cli back to summary

pack-priv final Class HelpFormatter.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private HelpFormatter.OptionGroupFormatter
private final List<HelpFormatter.OptionGroup>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv HelpFormatter
private static HelpFormatter.OptionGroupFormatter
pack-priv HelpFormatter.Builder
pack-priv HelpFormatter.Builder
pack-priv HelpFormatter.Builder
private HelpFormatter.OptionGroupFormatter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

groupFormatterback to summary
private HelpFormatter.OptionGroupFormatter groupFormatter
groupsback to summary
private final List<HelpFormatter.OptionGroup> groups

Constructor Detail

Builderback to summary
private Builder()

Method Detail

createback to summary
pack-priv HelpFormatter create()
createConsoleFormatterback to summary
private static HelpFormatter.OptionGroupFormatter createConsoleFormatter()
groupFormatterback to summary
pack-priv HelpFormatter.Builder groupFormatter(HelpFormatter.OptionGroupFormatter v)
groupsback to summary
pack-priv HelpFormatter.Builder groups(Collection<HelpFormatter.OptionGroup> v)
groupsback to summary
pack-priv HelpFormatter.Builder groups(HelpFormatter.OptionGroup... v)
validatedGroupFormatterback to summary
private HelpFormatter.OptionGroupFormatter validatedGroupFormatter()
jdk.jpackage.internal.cli back to summary

pack-priv final Record HelpFormatter.ConsoleOptionFormatter

extends Record
implements OptionFormatter
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.cli.HelpFormatter.OptionFormatter
Record Components
nameOffset:int 
descriptionOffset:int 

Field Summary

Modifier and TypeField and Description
private final int
descriptionOffset

Record Component accessed by descriptionOffset().

private final int
nameOffset

Record Component accessed by nameOffset().

Constructor Summary

AccessConstructor and Description
pack-priv
ConsoleOptionFormatter(int nameOffset, int descriptionOffset)

Method Summary

Modifier and TypeMethod and Description
public int
descriptionOffset()

Record Component getter of descriptionOffset.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public void
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public int
nameOffset()

Record Component getter of nameOffset.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

descriptionOffsetback to summary
private final int descriptionOffset

Record Component accessed by descriptionOffset().

nameOffsetback to summary
private final int nameOffset

Record Component accessed by nameOffset().

Constructor Detail

ConsoleOptionFormatterback to summary
pack-priv ConsoleOptionFormatter(int nameOffset, int descriptionOffset)

Method Detail

descriptionOffsetback to summary
public int descriptionOffset()

Record Component getter of descriptionOffset.

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).
formatback to summary
public void format(String optionNames, Optional<String> valuePattern, String description, Consumer<CharSequence> sink)

Implements jdk.jpackage.internal.cli.HelpFormatter.OptionFormatter.format.

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.

nameOffsetback to summary
public int nameOffset()

Record Component getter of nameOffset.

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

pack-priv final Record HelpFormatter.ConsoleOptionGroupFormatter

extends Record
implements OptionGroupFormatter
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.cli.HelpFormatter.OptionGroupFormatter
Record Components
optionFormatter:HelpFormatter.OptionFormatter 

Field Summary

Modifier and TypeField and Description
private final HelpFormatter.OptionFormatter
optionFormatter

Record Component accessed by optionFormatter().

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public void
public void
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public HelpFormatter.OptionFormatter
optionFormatter()

Record Component getter of optionFormatter.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

optionFormatterback to summary
private final HelpFormatter.OptionFormatter optionFormatter

Record Component accessed by optionFormatter().

Constructor Detail

ConsoleOptionGroupFormatterback to summary
pack-priv ConsoleOptionGroupFormatter(HelpFormatter.OptionFormatter optionFormatter)

Method Detail

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).
formatBodyback to summary
public void formatBody(Iterable<? extends OptionSpec<?>> optionSpecs, Consumer<CharSequence> sink)

Implements jdk.jpackage.internal.cli.HelpFormatter.OptionGroupFormatter.formatBody.

Annotations
@Override
formatHeaderback to summary
public void formatHeader(String groupName, Consumer<CharSequence> sink)

Implements jdk.jpackage.internal.cli.HelpFormatter.OptionGroupFormatter.formatHeader.

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.

optionFormatterback to summary
public HelpFormatter.OptionFormatter optionFormatter()

Record Component getter of optionFormatter.

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

pack-priv Interface HelpFormatter.OptionFormatter

Known Direct Implementers
jdk.jpackage.internal.cli.HelpFormatter.ConsoleOptionFormatter

Method Summary

Modifier and TypeMethod and Description
public default void
format(OptionSpec<?> optionSpec, Consumer<CharSequence> sink)

public void
format(String optionNames, Optional<String> valuePattern, String description, Consumer<CharSequence> sink)

Method Detail

formatback to summary
public default void format(OptionSpec<?> optionSpec, Consumer<CharSequence> sink)
formatback to summary
public void format(String optionNames, Optional<String> valuePattern, String description, Consumer<CharSequence> sink)
jdk.jpackage.internal.cli back to summary

pack-priv final Record HelpFormatter.OptionGroup

extends Record
Class Inheritance
Record Components
name:String 
options:List<? extends OptionSpec<?>> 

Field Summary

Modifier and TypeField and Description
private final String
name

Record Component accessed by name().

private final List<? extends OptionSpec<?>>
options

Record Component accessed by options().

Constructor Summary

AccessConstructor and Description
pack-priv
OptionGroup(String name, List<? extends OptionSpec<?>> options)

Method Summary

Modifier and TypeMethod and Description
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 String
name()

Record Component getter of name.

public List<? extends OptionSpec<?>>
options()

Record Component getter of options.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

nameback to summary
private final String name

Record Component accessed by name().

optionsback to summary
private final List<? extends OptionSpec<?>> options

Record Component accessed by options().

Constructor Detail

OptionGroupback to summary
pack-priv OptionGroup(String name, List<? extends OptionSpec<?>> options)

Method Detail

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.

nameback to summary
public String name()

Record Component getter of name.

optionsback to summary
public List<? extends OptionSpec<?>> options()

Record Component getter of options.

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

pack-priv Interface HelpFormatter.OptionGroupFormatter

Known Direct Implementers
jdk.jpackage.internal.cli.HelpFormatter.ConsoleOptionGroupFormatter, jdk.jpackage.internal.cli.StandardHelpFormatter.GroupFormatter, jdk.jpackage.internal.cli.StandardHelpFormatter.SampleGroupFormatter

Method Summary

Modifier and TypeMethod and Description
public default void
public void
formatBody(Iterable<? extends OptionSpec<?>> optionSpecs, Consumer<CharSequence> sink)

public void

Method Detail

formatback to summary
public default void format(HelpFormatter.OptionGroup group, Consumer<CharSequence> sink)
formatBodyback to summary
public void formatBody(Iterable<? extends OptionSpec<?>> optionSpecs, Consumer<CharSequence> sink)
formatHeaderback to summary
public void formatHeader(String gropName, Consumer<CharSequence> sink)