Package org.projectnessie.model
Class ImmutableEntry.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableEntry.Builder
-
- Enclosing class:
- ImmutableEntry
@NotThreadSafe public static final class ImmutableEntry.Builder extends Object
Builds instances of typeImmutableEntry. 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 ImmutableEntrybuild()Builds a newImmutableEntry.ImmutableEntry.Builderfrom(EntriesResponse.Entry instance)Fill a builder with attribute values from the providedEntryinstance.ImmutableEntry.Buildername(ContentKey name)Initializes the value for thenameattribute.ImmutableEntry.Buildertype(Content.Type type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableEntry.Builder from(EntriesResponse.Entry instance)
Fill a builder with attribute values from the providedEntryinstance. 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
-
type
@CanIgnoreReturnValue public final ImmutableEntry.Builder type(Content.Type type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableEntry.Builder name(ContentKey name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableEntry build()
Builds a newImmutableEntry.- Returns:
- An immutable instance of Entry
- Throws:
IllegalStateException- if any required attributes are missing
-
-