Package org.projectnessie.model
Class ImmutableTransplant.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableTransplant.Builder
-
- Enclosing class:
- ImmutableTransplant
@NotThreadSafe public static final class ImmutableTransplant.Builder extends Object
Builds instances of typeImmutableTransplant. 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 ImmutableTransplant.BuilderaddAllHashesToTransplant(Iterable<String> elements)Adds elements tohashesToTransplantlist.ImmutableTransplant.BuilderaddHashesToTransplant(String element)Adds one element tohashesToTransplantlist.ImmutableTransplant.BuilderaddHashesToTransplant(String... elements)Adds elements tohashesToTransplantlist.ImmutableTransplantbuild()Builds a newImmutableTransplant.ImmutableTransplant.Builderfrom(Transplant instance)Fill a builder with attribute values from the providedTransplantinstance.ImmutableTransplant.BuilderfromRefName(String fromRefName)Initializes the value for thefromRefNameattribute.ImmutableTransplant.BuilderhashesToTransplant(Iterable<String> elements)Sets or replaces all elements forhashesToTransplantlist.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableTransplant.Builder from(Transplant instance)
Fill a builder with attribute values from the providedTransplantinstance. 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
-
addHashesToTransplant
@CanIgnoreReturnValue public final ImmutableTransplant.Builder addHashesToTransplant(String element)
Adds one element tohashesToTransplantlist.- Parameters:
element- A hashesToTransplant element- Returns:
thisbuilder for use in a chained invocation
-
addHashesToTransplant
@CanIgnoreReturnValue public final ImmutableTransplant.Builder addHashesToTransplant(String... elements)
Adds elements tohashesToTransplantlist.- Parameters:
elements- An array of hashesToTransplant elements- Returns:
thisbuilder for use in a chained invocation
-
hashesToTransplant
@CanIgnoreReturnValue public final ImmutableTransplant.Builder hashesToTransplant(Iterable<String> elements)
Sets or replaces all elements forhashesToTransplantlist.- Parameters:
elements- An iterable of hashesToTransplant elements- Returns:
thisbuilder for use in a chained invocation
-
addAllHashesToTransplant
@CanIgnoreReturnValue public final ImmutableTransplant.Builder addAllHashesToTransplant(Iterable<String> elements)
Adds elements tohashesToTransplantlist.- Parameters:
elements- An iterable of hashesToTransplant elements- Returns:
thisbuilder for use in a chained invocation
-
fromRefName
@CanIgnoreReturnValue public final ImmutableTransplant.Builder fromRefName(String fromRefName)
Initializes the value for thefromRefNameattribute.- Parameters:
fromRefName- The value for fromRefName- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTransplant build()
Builds a newImmutableTransplant.- Returns:
- An immutable instance of Transplant
- Throws:
IllegalStateException- if any required attributes are missing
-
-