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 classImmutableMembership.BuilderBuilds instances of typeImmutableMembership.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMembership.Builderbuilder()Creates a builder forImmutableMembership.static ImmutableMembershipcopyOf(Membership instance)Creates an immutable copy of aMembershipvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMembershipthat have equal attribute values.inthashCode()Computes a hash code from attributes:url,role,state.Stringrole()ROLEStringstate()STATEStringtoString()Prints the immutable valueMembershipwith attribute values.URIurl()URLImmutableMembershipwithRole(String value)Copy the current immutable object by setting a value for theroleattribute.ImmutableMembershipwithState(String value)Copy the current immutable object by setting a value for thestateattribute.ImmutableMembershipwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
url
@Nullable public URI url()
URL- Specified by:
urlin interfaceMembership
-
role
@Nullable public String role()
ROLE- Specified by:
rolein interfaceMembership
-
state
@Nullable public String state()
STATE- Specified by:
statein interfaceMembership
-
withUrl
public final ImmutableMembership withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. 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
thisobject
-
withRole
public final ImmutableMembership withRole(@Nullable String value)
Copy the current immutable object by setting a value for theroleattribute. 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
thisobject
-
withState
public final ImmutableMembership withState(@Nullable String value)
Copy the current immutable object by setting a value for thestateattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMembershipthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:url,role,state.
-
toString
public String toString()
Prints the immutable valueMembershipwith attribute values.
-
copyOf
public static ImmutableMembership copyOf(Membership instance)
Creates an immutable copy of aMembershipvalue. 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) // nullableurl.role(String | null) // nullablerole.state(String | null) // nullablestate.build();- Returns:
- A new ImmutableMembership builder
-
-