Package io.resys.hdes.client.spi
Class ImmutableGitEntry.Builder
java.lang.Object
io.resys.hdes.client.spi.ImmutableGitEntry.Builder
- Enclosing class:
- ImmutableGitEntry
@NotThreadSafe public static final class ImmutableGitEntry.Builder extends Object
Builds instances of type
ImmutableGitEntry.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and Type Method Description ImmutableGitEntry.BuilderaddAllCommands(Iterable<? extends AstCommand> elements)Adds elements tocommandslist.ImmutableGitEntry.BuilderaddCommands(AstCommand element)Adds one element tocommandslist.ImmutableGitEntry.BuilderaddCommands(AstCommand... elements)Adds elements tocommandslist.ImmutableGitEntry.BuilderblobHash(String blobHash)Initializes the value for theblobHashattribute.ImmutableGitEntry.BuilderblobValue(String blobValue)Initializes the value for theblobValueattribute.ImmutableGitEntry.BuilderbodyType(AstBody.AstBodyType bodyType)Initializes the value for thebodyTypeattribute.ImmutableGitEntrybuild()Builds a newImmutableGitEntry.ImmutableGitEntry.Buildercommands(Iterable<? extends AstCommand> elements)Sets or replaces all elements forcommandslist.ImmutableGitEntry.Buildercreated(Timestamp created)Initializes the value for thecreatedattribute.ImmutableGitEntry.Builderfrom(GitConfig.GitEntry instance)Fill a builder with attribute values from the providedGitEntryinstance.ImmutableGitEntry.Builderid(String id)Initializes the value for theidattribute.ImmutableGitEntry.Buildermodified(Timestamp modified)Initializes the value for themodifiedattribute.ImmutableGitEntry.Builderrevision(String revision)Initializes the value for therevisionattribute.ImmutableGitEntry.BuildertreeValue(String treeValue)Initializes the value for thetreeValueattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedGitEntryinstance. 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
-
id
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
created
Initializes the value for thecreatedattribute.- Parameters:
created- The value for created- Returns:
thisbuilder for use in a chained invocation
-
modified
Initializes the value for themodifiedattribute.- Parameters:
modified- The value for modified- Returns:
thisbuilder for use in a chained invocation
-
bodyType
@CanIgnoreReturnValue public final ImmutableGitEntry.Builder bodyType(AstBody.AstBodyType bodyType)Initializes the value for thebodyTypeattribute.- Parameters:
bodyType- The value for bodyType- Returns:
thisbuilder for use in a chained invocation
-
revision
Initializes the value for therevisionattribute.- Parameters:
revision- The value for revision- Returns:
thisbuilder for use in a chained invocation
-
blobHash
Initializes the value for theblobHashattribute.- Parameters:
blobHash- The value for blobHash- Returns:
thisbuilder for use in a chained invocation
-
treeValue
Initializes the value for thetreeValueattribute.- Parameters:
treeValue- The value for treeValue- Returns:
thisbuilder for use in a chained invocation
-
blobValue
Initializes the value for theblobValueattribute.- Parameters:
blobValue- The value for blobValue- Returns:
thisbuilder for use in a chained invocation
-
addCommands
Adds one element tocommandslist.- Parameters:
element- A commands element- Returns:
thisbuilder for use in a chained invocation
-
addCommands
Adds elements tocommandslist.- Parameters:
elements- An array of commands elements- Returns:
thisbuilder for use in a chained invocation
-
commands
@CanIgnoreReturnValue public final ImmutableGitEntry.Builder commands(Iterable<? extends AstCommand> elements)Sets or replaces all elements forcommandslist.- Parameters:
elements- An iterable of commands elements- Returns:
thisbuilder for use in a chained invocation
-
addAllCommands
@CanIgnoreReturnValue public final ImmutableGitEntry.Builder addAllCommands(Iterable<? extends AstCommand> elements)Adds elements tocommandslist.- Parameters:
elements- An iterable of commands elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableGitEntry.- Returns:
- An immutable instance of GitEntry
- Throws:
IllegalStateException- if any required attributes are missing
-