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.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 ImmutableParentItem
build()
Builds a newImmutableParentItem
.ImmutableParentItem.Builder
from(ParentItem instance)
Fill a builder with attribute values from the providedParentItem
instance.ImmutableParentItem.Builder
htmlUrl(URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.ImmutableParentItem.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableParentItem.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableParentItem.Builder from(ParentItem instance)
Fill a builder with attribute values from the providedParentItem
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
-
sha
@CanIgnoreReturnValue public final ImmutableParentItem.Builder sha(@Nullable String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha (can benull
)- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableParentItem.Builder url(@Nullable URI url)
Initializes the value for theurl
attribute.- Parameters:
url
- The value for url (can benull
)- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableParentItem.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.- Parameters:
htmlUrl
- The value for htmlUrl (can benull
)- Returns:
this
builder 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
-
-