Package org.projectnessie.model
Class ImmutableBranch.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableBranch.Builder
-
- Enclosing class:
- ImmutableBranch
@NotThreadSafe public static final class ImmutableBranch.Builder extends Object
Builds instances of typeImmutableBranch. 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 ImmutableBranchbuild()Builds a newImmutableBranch.ImmutableBranch.Builderfrom(Branch instance)Fill a builder with attribute values from the providedorg.projectnessie.model.Branchinstance.ImmutableBranch.Builderfrom(Reference instance)Fill a builder with attribute values from the providedorg.projectnessie.model.Referenceinstance.ImmutableBranch.Builderhash(String hash)Initializes the value for thehashattribute.ImmutableBranch.Buildermetadata(ReferenceMetadata metadata)Initializes the value for themetadataattribute.ImmutableBranch.Buildername(String name)Initializes the value for thenameattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableBranch.Builder from(Reference instance)
Fill a builder with attribute values from the providedorg.projectnessie.model.Referenceinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableBranch.Builder from(Branch instance)
Fill a builder with attribute values from the providedorg.projectnessie.model.Branchinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableBranch.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
hash
@CanIgnoreReturnValue public final ImmutableBranch.Builder hash(@Nullable String hash)
Initializes the value for thehashattribute.- Parameters:
hash- The value for hash (can benull)- Returns:
thisbuilder for use in a chained invocation
-
metadata
@CanIgnoreReturnValue public final ImmutableBranch.Builder metadata(@Nullable ReferenceMetadata metadata)
Initializes the value for themetadataattribute.- Parameters:
metadata- The value for metadata (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableBranch build()
Builds a newImmutableBranch.- Returns:
- An immutable instance of Branch
- Throws:
IllegalStateException- if any required attributes are missing
-
-