Package com.spotify.github.v3.git
Class ImmutableStatItem.Builder
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableStatItem.Builder
-
- Enclosing class:
- ImmutableStatItem
@NotThreadSafe public static final class ImmutableStatItem.Builder extends Object
Builds instances of typeImmutableStatItem
. Initialize attributes and then invoke thebuild()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableStatItem.Builder
additions(Integer additions)
Initializes the value for theadditions
attribute.ImmutableStatItem
build()
Builds a newImmutableStatItem
.ImmutableStatItem.Builder
deletions(Integer deletions)
Initializes the value for thedeletions
attribute.ImmutableStatItem.Builder
from(StatItem instance)
Fill a builder with attribute values from the providedStatItem
instance.ImmutableStatItem.Builder
total(Integer total)
Initializes the value for thetotal
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableStatItem.Builder from(StatItem instance)
Fill a builder with attribute values from the providedStatItem
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
total
@CanIgnoreReturnValue public final ImmutableStatItem.Builder total(@Nullable Integer total)
Initializes the value for thetotal
attribute.- Parameters:
total
- The value for total (can benull
)- Returns:
this
builder for use in a chained invocation
-
additions
@CanIgnoreReturnValue public final ImmutableStatItem.Builder additions(@Nullable Integer additions)
Initializes the value for theadditions
attribute.- Parameters:
additions
- The value for additions (can benull
)- Returns:
this
builder for use in a chained invocation
-
deletions
@CanIgnoreReturnValue public final ImmutableStatItem.Builder deletions(@Nullable Integer deletions)
Initializes the value for thedeletions
attribute.- Parameters:
deletions
- The value for deletions (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableStatItem build()
Builds a newImmutableStatItem
.- Returns:
- An immutable instance of StatItem
- Throws:
IllegalStateException
- if any required attributes are missing
-
-