Package org.projectnessie.model
Class ImmutableCommitMeta.Builder
- java.lang.Object
-
- org.projectnessie.model.ImmutableCommitMeta.Builder
-
- Enclosing class:
- ImmutableCommitMeta
@NotThreadSafe public static final class ImmutableCommitMeta.Builder extends Object
Builds instances of typeImmutableCommitMeta. 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 ImmutableCommitMeta.Builderauthor(String author)Initializes the value for theauthorattribute.ImmutableCommitMeta.BuilderauthorTime(Instant authorTime)Initializes the value for theauthorTimeattribute.ImmutableCommitMetabuild()Builds a newImmutableCommitMeta.ImmutableCommitMeta.Buildercommitter(String committer)Initializes the value for thecommitterattribute.ImmutableCommitMeta.BuildercommitTime(Instant commitTime)Initializes the value for thecommitTimeattribute.ImmutableCommitMeta.Builderfrom(CommitMeta instance)Fill a builder with attribute values from the providedCommitMetainstance.ImmutableCommitMeta.Builderhash(String hash)Initializes the value for thehashattribute.ImmutableCommitMeta.Buildermessage(String message)Initializes the value for themessageattribute.ImmutableCommitMeta.Builderproperties(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for thepropertiesmap.ImmutableCommitMeta.BuilderputAllProperties(Map<String,? extends String> entries)Put all mappings from the specified map as entries topropertiesmap.ImmutableCommitMeta.BuilderputProperties(String key, String value)Put one entry to thepropertiesmap.ImmutableCommitMeta.BuilderputProperties(Map.Entry<String,? extends String> entry)Put one entry to thepropertiesmap.ImmutableCommitMeta.BuildersignedOffBy(String signedOffBy)Initializes the value for thesignedOffByattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder from(CommitMeta instance)
Fill a builder with attribute values from the providedCommitMetainstance. 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
-
hash
@CanIgnoreReturnValue public final ImmutableCommitMeta.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
-
committer
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder committer(@Nullable String committer)
Initializes the value for thecommitterattribute.- Parameters:
committer- The value for committer (can benull)- Returns:
thisbuilder for use in a chained invocation
-
author
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder author(@Nullable String author)
Initializes the value for theauthorattribute.- Parameters:
author- The value for author (can benull)- Returns:
thisbuilder for use in a chained invocation
-
signedOffBy
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder signedOffBy(@Nullable String signedOffBy)
Initializes the value for thesignedOffByattribute.- Parameters:
signedOffBy- The value for signedOffBy (can benull)- Returns:
thisbuilder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder message(String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
commitTime
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder commitTime(@Nullable Instant commitTime)
Initializes the value for thecommitTimeattribute.- Parameters:
commitTime- The value for commitTime (can benull)- Returns:
thisbuilder for use in a chained invocation
-
authorTime
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder authorTime(@Nullable Instant authorTime)
Initializes the value for theauthorTimeattribute.- Parameters:
authorTime- The value for authorTime (can benull)- Returns:
thisbuilder for use in a chained invocation
-
putProperties
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder putProperties(String key, String value)
Put one entry to thepropertiesmap.- Parameters:
key- The key in the properties mapvalue- The associated value in the properties map- Returns:
thisbuilder for use in a chained invocation
-
putProperties
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder putProperties(Map.Entry<String,? extends String> entry)
Put one entry to thepropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
properties
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder properties(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for thepropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the properties map- Returns:
thisbuilder for use in a chained invocation
-
putAllProperties
@CanIgnoreReturnValue public final ImmutableCommitMeta.Builder putAllProperties(Map<String,? extends String> entries)
Put all mappings from the specified map as entries topropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the properties map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCommitMeta build()
Builds a newImmutableCommitMeta.- Returns:
- An immutable instance of CommitMeta
- Throws:
IllegalStateException- if any required attributes are missing
-
-