Package org.incendo.cloud.caption
Class ImmutableConstantCaptionProvider<C>
java.lang.Object
org.incendo.cloud.caption.ConstantCaptionProvider<C>
org.incendo.cloud.caption.ImmutableConstantCaptionProvider<C>
- All Implemented Interfaces:
CaptionProvider<C>
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
@API(status=STABLE,
consumers="org.incendo.cloud.*")
public final class ImmutableConstantCaptionProvider<C>
extends ConstantCaptionProvider<C>
Immutable implementation of
ConstantCaptionProvider.
Use the builder to create immutable instances:
ImmutableConstantCaptionProvider.builder().
Use the static factory method to create immutable instances:
ImmutableConstantCaptionProvider.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableConstantCaptionProvider. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> ImmutableConstantCaptionProvider.Builder<C> builder()Creates a builder forImmutableConstantCaptionProvider.captions()Returns all recognized captions and their corresponding constant values.static <C> ImmutableConstantCaptionProvider<C> copyOf(ConstantCaptionProvider<C> instance) Creates an immutable copy of aConstantCaptionProvidervalue.booleanThis instance is equal to all instances ofImmutableConstantCaptionProviderthat have equal attribute values.inthashCode()Computes a hash code from attributes:captions.static <C> ImmutableConstantCaptionProvider<C> Construct a new immutableConstantCaptionProviderinstance.toString()Prints the immutable valueConstantCaptionProviderwith attribute values.withCaptions(Map<? extends Caption, ? extends String> entries) Copy the current immutable object by replacing thecaptionsmap with the specified map.Methods inherited from class org.incendo.cloud.caption.ConstantCaptionProvider
provide
-
Method Details
-
captions
Returns all recognized captions and their corresponding constant values.- Specified by:
captionsin classConstantCaptionProvider<C>- Returns:
- the captions
-
withCaptions
public final ImmutableConstantCaptionProvider<C> withCaptions(Map<? extends Caption, ? extends String> entries) Copy the current immutable object by replacing thecaptionsmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the captions map- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableConstantCaptionProviderthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:captions. -
toString
Prints the immutable valueConstantCaptionProviderwith attribute values. -
of
public static <C> ImmutableConstantCaptionProvider<C> of(Map<? extends Caption, ? extends String> captions) Construct a new immutableConstantCaptionProviderinstance.- Type Parameters:
C- generic parameter C- Parameters:
captions- The value for thecaptionsattribute- Returns:
- An immutable ConstantCaptionProvider instance
-
copyOf
Creates an immutable copy of aConstantCaptionProvidervalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
C- generic parameter C- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ConstantCaptionProvider instance
-
builder
Creates a builder forImmutableConstantCaptionProvider.ImmutableConstantCaptionProvider.<C>builder() .putCaption|putAllCaptions(org.incendo.cloud.caption.Caption => String) //captionsmappings .build();- Type Parameters:
C- generic parameter C- Returns:
- A new ImmutableConstantCaptionProvider builder
-