Package org.incendo.cloud.caption
Class ImmutableConstantCaptionProvider.Builder<C>
java.lang.Object
org.incendo.cloud.caption.ImmutableConstantCaptionProvider.Builder<C>
- Enclosing class:
ImmutableConstantCaptionProvider<C>
Builds instances of type
ImmutableConstantCaptionProvider.
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 newImmutableConstantCaptionProvider.Sets or replaces all mappings from the specified map as entries for thecaptionsmap.from(ConstantCaptionProvider<C> instance) Fill a builder with attribute values from the providedConstantCaptionProviderinstance.putAllCaptions(Map<? extends Caption, ? extends String> entries) Put all mappings from the specified map as entries tocaptionsmap.putCaption(Map.Entry<? extends Caption, ? extends String> entry) Put one entry to thecaptionsmap.putCaption(Caption key, String value) Put one entry to thecaptionsmap.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableConstantCaptionProvider.Builder<C> from(ConstantCaptionProvider<C> instance) Fill a builder with attribute values from the providedConstantCaptionProviderinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
putCaption
@CanIgnoreReturnValue public final ImmutableConstantCaptionProvider.Builder<C> putCaption(Caption key, String value) Put one entry to thecaptionsmap.- Parameters:
key- The key in the captions mapvalue- The associated value in the captions map- Returns:
thisbuilder for use in a chained invocation
-
putCaption
@CanIgnoreReturnValue public final ImmutableConstantCaptionProvider.Builder<C> putCaption(Map.Entry<? extends Caption, ? extends String> entry) Put one entry to thecaptionsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
captions
@CanIgnoreReturnValue public final ImmutableConstantCaptionProvider.Builder<C> captions(Map<? extends Caption, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thecaptionsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the captions map- Returns:
thisbuilder for use in a chained invocation
-
putAllCaptions
@CanIgnoreReturnValue public final ImmutableConstantCaptionProvider.Builder<C> putAllCaptions(Map<? extends Caption, ? extends String> entries) Put all mappings from the specified map as entries tocaptionsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the captions map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableConstantCaptionProvider.- Returns:
- An immutable instance of ConstantCaptionProvider
- Throws:
IllegalStateException- if any required attributes are missing
-