Class ImmutableOrgMembership

  • All Implemented Interfaces:
    OrgMembership

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableOrgMembership
    extends Object
    implements OrgMembership
    Immutable implementation of OrgMembership.

    Use the builder to create immutable instances: ImmutableOrgMembership.builder().

    • Method Detail

      • withUrl

        public final ImmutableOrgMembership withUrl​(@Nullable
                                                    URI value)
        Copy the current immutable object by setting a value for the url attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for url (can be null)
        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 the role attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for role (can be null)
        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 the state attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for state (can be null)
        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 the organization attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for organization (can be null)
        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 the user attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for user (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableOrgMembership that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: url, role, state, organization, user.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value OrgMembership with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableOrgMembership copyOf​(OrgMembership instance)
        Creates an immutable copy of a OrgMembership 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 for ImmutableOrgMembership.
         ImmutableOrgMembership.builder()
            .url(java.net.URI | null) // nullable url
            .role(String | null) // nullable role
            .state(String | null) // nullable state
            .organization(com.spotify.github.v3.repos.Organization | null) // nullable organization
            .user(com.spotify.github.v3.User | null) // nullable user
            .build();
         
        Returns:
        A new ImmutableOrgMembership builder