Package com.spotify.github.v3.git
Class ImmutableParentItem.Builder
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableParentItem.Builder
-
- Enclosing class:
- ImmutableParentItem
@NotThreadSafe public static final class ImmutableParentItem.Builder extends Object
Builds instances of typeImmutableParentItem. 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 ImmutableParentItembuild()Builds a newImmutableParentItem.ImmutableParentItem.Builderfrom(ParentItem instance)Fill a builder with attribute values from the providedParentIteminstance.ImmutableParentItem.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableParentItem.Buildersha(String sha)Initializes the value for theshaattribute.ImmutableParentItem.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableParentItem.Builder from(ParentItem instance)
Fill a builder with attribute values from the providedParentIteminstance. 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
-
sha
@CanIgnoreReturnValue public final ImmutableParentItem.Builder sha(@Nullable String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableParentItem.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableParentItem.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrlattribute.- Parameters:
htmlUrl- The value for htmlUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableParentItem build()
Builds a newImmutableParentItem.- Returns:
- An immutable instance of ParentItem
- Throws:
IllegalStateException- if any required attributes are missing
-
-