Class ImmutableArgumentDescriptor.Builder
java.lang.Object
org.incendo.cloud.annotations.descriptor.ImmutableArgumentDescriptor.Builder
- Enclosing class:
ImmutableArgumentDescriptor
Builds instances of type
ImmutableArgumentDescriptor.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableArgumentDescriptor.defaultValue(@Nullable DefaultValue<?, ?> defaultValue) Initializes the value for thedefaultValueattribute.description(@Nullable Description description) Initializes the value for thedescriptionattribute.from(ArgumentDescriptor instance) Fill a builder with attribute values from the providedorg.incendo.cloud.annotations.descriptor.ArgumentDescriptorinstance.from(Descriptor instance) Fill a builder with attribute values from the providedorg.incendo.cloud.annotations.descriptor.Descriptorinstance.Initializes the value for thenameattribute.Initializes the value for theparameterattribute.parserName(@Nullable String parserName) Initializes the value for theparserNameattribute.suggestions(@Nullable String suggestions) Initializes the value for thesuggestionsattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder from(ArgumentDescriptor instance) Fill a builder with attribute values from the providedorg.incendo.cloud.annotations.descriptor.ArgumentDescriptorinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedorg.incendo.cloud.annotations.descriptor.Descriptorinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
parameter
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder parameter(@NonNull Parameter parameter) Initializes the value for theparameterattribute.- Parameters:
parameter- The value for parameter- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
parserName
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder parserName(@Nullable String parserName) Initializes the value for theparserNameattribute.- Parameters:
parserName- The value for parserName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
suggestions
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder suggestions(@Nullable String suggestions) Initializes the value for thesuggestionsattribute.- Parameters:
suggestions- The value for suggestions (can benull)- Returns:
thisbuilder for use in a chained invocation
-
defaultValue
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder defaultValue(@Nullable DefaultValue<?, ?> defaultValue) Initializes the value for thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableArgumentDescriptor.Builder description(@Nullable Description description) Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableArgumentDescriptor.- Returns:
- An immutable instance of ArgumentDescriptor
- Throws:
IllegalStateException- if any required attributes are missing
-