Package com.spotify.github.v3.orgs
Class ImmutableMembership
- java.lang.Object
-
- com.spotify.github.v3.orgs.ImmutableMembership
-
- All Implemented Interfaces:
Membership
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMembership extends Object implements Membership
Immutable implementation ofMembership
.Use the builder to create immutable instances:
ImmutableMembership.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableMembership.Builder
Builds instances of typeImmutableMembership
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMembership.Builder
builder()
Creates a builder forImmutableMembership
.static ImmutableMembership
copyOf(Membership instance)
Creates an immutable copy of aMembership
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableMembership
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:url
,role
,state
.String
role()
ROLEString
state()
STATEString
toString()
Prints the immutable valueMembership
with attribute values.URI
url()
URLImmutableMembership
withRole(String value)
Copy the current immutable object by setting a value for therole
attribute.ImmutableMembership
withState(String value)
Copy the current immutable object by setting a value for thestate
attribute.ImmutableMembership
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
url
@Nullable public URI url()
URL- Specified by:
url
in interfaceMembership
-
role
@Nullable public String role()
ROLE- Specified by:
role
in interfaceMembership
-
state
@Nullable public String state()
STATE- Specified by:
state
in interfaceMembership
-
withUrl
public final ImmutableMembership withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for url (can benull
)- Returns:
- A modified copy of the
this
object
-
withRole
public final ImmutableMembership withRole(@Nullable String value)
Copy the current immutable object by setting a value for therole
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for role (can benull
)- Returns:
- A modified copy of the
this
object
-
withState
public final ImmutableMembership withState(@Nullable String value)
Copy the current immutable object by setting a value for thestate
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for state (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableMembership
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:url
,role
,state
.
-
toString
public String toString()
Prints the immutable valueMembership
with attribute values.
-
copyOf
public static ImmutableMembership copyOf(Membership instance)
Creates an immutable copy of aMembership
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable Membership instance
-
builder
public static ImmutableMembership.Builder builder()
Creates a builder forImmutableMembership
.ImmutableMembership.builder() .url(java.net.URI | null) // nullable
url
.role(String | null) // nullablerole
.state(String | null) // nullablestate
.build();- Returns:
- A new ImmutableMembership builder
-
-