Package org.projectnessie.model
Class ImmutableContentWithKey.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableContentWithKey.Builder
-
- Enclosing class:
- ImmutableContentWithKey
@NotThreadSafe public static final class ImmutableContentWithKey.Builder extends Object
Builds instances of typeImmutableContentWithKey. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableContentWithKeybuild()Builds a newImmutableContentWithKey.ImmutableContentWithKey.Buildercontent(Content content)Initializes the value for thecontentattribute.ImmutableContentWithKey.Builderfrom(GetMultipleContentsResponse.ContentWithKey instance)Fill a builder with attribute values from the providedContentWithKeyinstance.ImmutableContentWithKey.Builderkey(ContentKey key)Initializes the value for thekeyattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableContentWithKey.Builder from(GetMultipleContentsResponse.ContentWithKey instance)
Fill a builder with attribute values from the providedContentWithKeyinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
key
@CanIgnoreReturnValue public final ImmutableContentWithKey.Builder key(ContentKey key)
Initializes the value for thekeyattribute.- Parameters:
key- The value for key- Returns:
thisbuilder for use in a chained invocation
-
content
@CanIgnoreReturnValue public final ImmutableContentWithKey.Builder content(Content content)
Initializes the value for thecontentattribute.- Parameters:
content- The value for content- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableContentWithKey build()
Builds a newImmutableContentWithKey.- Returns:
- An immutable instance of ContentWithKey
- Throws:
IllegalStateException- if any required attributes are missing
-
-