Package com.spotify.github.v3.orgs
Class ImmutableOrgMembership
- java.lang.Object
-
- com.spotify.github.v3.orgs.ImmutableOrgMembership
-
- All Implemented Interfaces:
OrgMembership
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableOrgMembership extends Object implements OrgMembership
Immutable implementation ofOrgMembership
.Use the builder to create immutable instances:
ImmutableOrgMembership.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableOrgMembership.Builder
Builds instances of typeImmutableOrgMembership
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOrgMembership.Builder
builder()
Creates a builder forImmutableOrgMembership
.static ImmutableOrgMembership
copyOf(OrgMembership instance)
Creates an immutable copy of aOrgMembership
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableOrgMembership
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:url
,role
,state
,organization
,user
.Organization
organization()
String
role()
ROLEString
state()
STATEString
toString()
Prints the immutable valueOrgMembership
with attribute values.URI
url()
URLUser
user()
USERImmutableOrgMembership
withOrganization(Organization value)
Copy the current immutable object by setting a value for theorganization
attribute.ImmutableOrgMembership
withRole(String value)
Copy the current immutable object by setting a value for therole
attribute.ImmutableOrgMembership
withState(String value)
Copy the current immutable object by setting a value for thestate
attribute.ImmutableOrgMembership
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.ImmutableOrgMembership
withUser(User value)
Copy the current immutable object by setting a value for theuser
attribute.
-
-
-
Method Detail
-
url
@Nullable public URI url()
URL- Specified by:
url
in interfaceOrgMembership
-
role
@Nullable public String role()
ROLE- Specified by:
role
in interfaceOrgMembership
-
state
@Nullable public String state()
STATE- Specified by:
state
in interfaceOrgMembership
-
organization
@Nullable public Organization organization()
- Specified by:
organization
in interfaceOrgMembership
- Returns:
- The value of the
organization
attribute
-
user
@Nullable public User user()
USER- Specified by:
user
in interfaceOrgMembership
-
withUrl
public final ImmutableOrgMembership 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 ImmutableOrgMembership 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 ImmutableOrgMembership 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
-
withOrganization
public final ImmutableOrgMembership withOrganization(@Nullable Organization value)
Copy the current immutable object by setting a value for theorganization
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for organization (can benull
)- Returns:
- A modified copy of the
this
object
-
withUser
public final ImmutableOrgMembership withUser(@Nullable User value)
Copy the current immutable object by setting a value for theuser
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for user (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableOrgMembership
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:url
,role
,state
,organization
,user
.
-
toString
public String toString()
Prints the immutable valueOrgMembership
with attribute values.
-
copyOf
public static ImmutableOrgMembership copyOf(OrgMembership instance)
Creates an immutable copy of aOrgMembership
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 OrgMembership instance
-
builder
public static ImmutableOrgMembership.Builder builder()
Creates a builder forImmutableOrgMembership
.ImmutableOrgMembership.builder() .url(java.net.URI | null) // nullable
url
.role(String | null) // nullablerole
.state(String | null) // nullablestate
.organization(com.spotify.github.v3.repos.Organization | null) // nullableorganization
.user(com.spotify.github.v3.User | null) // nullableuser
.build();- Returns:
- A new ImmutableOrgMembership builder
-
-