Package com.spotify.github.v3.git
Class ImmutableReferenceObject.Builder
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableReferenceObject.Builder
-
- Enclosing class:
- ImmutableReferenceObject
@NotThreadSafe public static final class ImmutableReferenceObject.Builder extends Object
Builds instances of typeImmutableReferenceObject
. 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 ImmutableReferenceObject
build()
Builds a newImmutableReferenceObject
.ImmutableReferenceObject.Builder
from(ReferenceObject instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ReferenceObject
instance.ImmutableReferenceObject.Builder
from(ShaLink instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLink
instance.ImmutableReferenceObject.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableReferenceObject.Builder
type(String type)
Initializes the value for thetype
attribute.ImmutableReferenceObject.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableReferenceObject.Builder from(ReferenceObject instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ReferenceObject
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableReferenceObject.Builder from(ShaLink instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLink
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableReferenceObject.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 ImmutableReferenceObject.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
-
type
@CanIgnoreReturnValue public final ImmutableReferenceObject.Builder type(@Nullable String type)
Initializes the value for thetype
attribute.- Parameters:
type
- The value for type (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableReferenceObject build()
Builds a newImmutableReferenceObject
.- Returns:
- An immutable instance of ReferenceObject
- Throws:
IllegalStateException
- if any required attributes are missing
-
-