@NotThreadSafe public static final class ImmutableEntity.Builder extends Object
ImmutableEntity.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableEntity |
build()
Builds a new
ImmutableEntity. |
ImmutableEntity.Builder |
customProperties(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for the
customProperties map. |
ImmutableEntity.Builder |
description(String description)
Initializes the value for the
description attribute. |
ImmutableEntity.Builder |
entityIdentifier(String entityIdentifier)
Initializes the value for the
entityIdentifier attribute. |
ImmutableEntity.Builder |
from(Entity instance)
Fill a builder with attribute values from the provided
Entity instance. |
ImmutableEntity.Builder |
hasNestedEntities(boolean hasNestedEntities)
Initializes the value for the
hasNestedEntities attribute. |
ImmutableEntity.Builder |
isWritable(boolean isWritable)
Initializes the value for the
isWritable attribute. |
ImmutableEntity.Builder |
label(String label)
Initializes the value for the
label attribute. |
ImmutableEntity.Builder |
putAllCustomProperties(Map<String,? extends String> entries)
Put all mappings from the specified map as entries to
customProperties map. |
ImmutableEntity.Builder |
putCustomProperties(Map.Entry<String,? extends String> entry)
Put one entry to the
customProperties map. |
ImmutableEntity.Builder |
putCustomProperties(String key,
String value)
Put one entry to the
customProperties map. |
public final ImmutableEntity.Builder from(Entity instance)
Entity instance.
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.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableEntity.Builder entityIdentifier(String entityIdentifier)
entityIdentifier attribute.entityIdentifier - The value for entityIdentifierthis builder for use in a chained invocationpublic final ImmutableEntity.Builder hasNestedEntities(boolean hasNestedEntities)
hasNestedEntities attribute.hasNestedEntities - The value for hasNestedEntitiesthis builder for use in a chained invocationpublic final ImmutableEntity.Builder isWritable(boolean isWritable)
isWritable attribute.
If not set, this attribute will have a default value as returned by the initializer of isWritable.
isWritable - The value for isWritablethis builder for use in a chained invocationpublic final ImmutableEntity.Builder label(@Nullable String label)
label attribute.label - The value for label (can be null)this builder for use in a chained invocationpublic final ImmutableEntity.Builder description(@Nullable String description)
description attribute.description - The value for description (can be null)this builder for use in a chained invocationpublic final ImmutableEntity.Builder putCustomProperties(String key, String value)
customProperties map.key - The key in the customProperties mapvalue - The associated value in the customProperties mapthis builder for use in a chained invocationpublic final ImmutableEntity.Builder putCustomProperties(Map.Entry<String,? extends String> entry)
customProperties map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocationpublic final ImmutableEntity.Builder customProperties(@Nullable Map<String,? extends String> entries)
customProperties map. Nulls are not permitted as keys or values, but parameter itself can be nullentries - The entries that will be added to the customProperties mapthis builder for use in a chained invocationpublic final ImmutableEntity.Builder putAllCustomProperties(Map<String,? extends String> entries)
customProperties map. Nulls are not permittedentries - The entries that will be added to the customProperties mapthis builder for use in a chained invocationpublic ImmutableEntity build()
ImmutableEntity.IllegalStateException - if any required attributes are missingCopyright © 2021–2022 Amazon Web Services. All rights reserved.