Package org.projectnessie.model
Class ImmutableLogEntry.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableLogEntry.Builder
-
- Enclosing class:
- ImmutableLogEntry
@NotThreadSafe public static final class ImmutableLogEntry.Builder extends Object
Builds instances of typeImmutableLogEntry. 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 ImmutableLogEntry.BuilderaddAllOperations(Iterable<? extends Operation> elements)Adds elements tooperationslist.ImmutableLogEntry.BuilderaddOperations(Operation element)Adds one element tooperationslist.ImmutableLogEntry.BuilderaddOperations(Operation... elements)Adds elements tooperationslist.ImmutableLogEntrybuild()Builds a newImmutableLogEntry.ImmutableLogEntry.BuildercommitMeta(CommitMeta commitMeta)Initializes the value for thecommitMetaattribute.ImmutableLogEntry.Builderfrom(LogResponse.LogEntry instance)Fill a builder with attribute values from the providedLogEntryinstance.ImmutableLogEntry.Builderoperations(Iterable<? extends Operation> elements)Sets or replaces all elements foroperationslist.ImmutableLogEntry.BuilderparentCommitHash(String parentCommitHash)Initializes the value for theparentCommitHashattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder from(LogResponse.LogEntry instance)
Fill a builder with attribute values from the providedLogEntryinstance. 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
-
commitMeta
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder commitMeta(CommitMeta commitMeta)
Initializes the value for thecommitMetaattribute.- Parameters:
commitMeta- The value for commitMeta- Returns:
thisbuilder for use in a chained invocation
-
parentCommitHash
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder parentCommitHash(@Nullable String parentCommitHash)
Initializes the value for theparentCommitHashattribute.- Parameters:
parentCommitHash- The value for parentCommitHash (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addOperations
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder addOperations(Operation element)
Adds one element tooperationslist.- Parameters:
element- A operations element- Returns:
thisbuilder for use in a chained invocation
-
addOperations
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder addOperations(Operation... elements)
Adds elements tooperationslist.- Parameters:
elements- An array of operations elements- Returns:
thisbuilder for use in a chained invocation
-
operations
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder operations(@Nullable Iterable<? extends Operation> elements)
Sets or replaces all elements foroperationslist.- Parameters:
elements- An iterable of operations elements- Returns:
thisbuilder for use in a chained invocation
-
addAllOperations
@CanIgnoreReturnValue public final ImmutableLogEntry.Builder addAllOperations(Iterable<? extends Operation> elements)
Adds elements tooperationslist.- Parameters:
elements- An iterable of operations elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableLogEntry build()
Builds a newImmutableLogEntry.- Returns:
- An immutable instance of LogEntry
- Throws:
IllegalStateException- if any required attributes are missing
-
-