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.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 ImmutableStatItem.Builderadditions(Integer additions)Initializes the value for theadditionsattribute.ImmutableStatItembuild()Builds a newImmutableStatItem.ImmutableStatItem.Builderdeletions(Integer deletions)Initializes the value for thedeletionsattribute.ImmutableStatItem.Builderfrom(StatItem instance)Fill a builder with attribute values from the providedStatIteminstance.ImmutableStatItem.Buildertotal(Integer total)Initializes the value for thetotalattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableStatItem.Builder from(StatItem instance)
Fill a builder with attribute values from the providedStatIteminstance. 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:
thisbuilder for use in a chained invocation
-
total
@CanIgnoreReturnValue public final ImmutableStatItem.Builder total(@Nullable Integer total)
Initializes the value for thetotalattribute.- Parameters:
total- The value for total (can benull)- Returns:
thisbuilder for use in a chained invocation
-
additions
@CanIgnoreReturnValue public final ImmutableStatItem.Builder additions(@Nullable Integer additions)
Initializes the value for theadditionsattribute.- Parameters:
additions- The value for additions (can benull)- Returns:
thisbuilder for use in a chained invocation
-
deletions
@CanIgnoreReturnValue public final ImmutableStatItem.Builder deletions(@Nullable Integer deletions)
Initializes the value for thedeletionsattribute.- Parameters:
deletions- The value for deletions (can benull)- Returns:
thisbuilder 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
-
-