Class ImmutableUser

  • All Implemented Interfaces:
    User

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

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

    • Method Detail

      • login

        @Nullable
        public String login()
        Login name.
        Specified by:
        login in interface User
      • id

        @Nullable
        public Integer id()
        ID.
        Specified by:
        id in interface User
      • avatarUrl

        @Nullable
        public URI avatarUrl()
        Avatar URL.
        Specified by:
        avatarUrl in interface User
      • url

        @Nullable
        public URI url()
        User resource API URL.
        Specified by:
        url in interface User
      • htmlUrl

        @Nullable
        public URI htmlUrl()
        User resource URL returning HTML.
        Specified by:
        htmlUrl in interface User
      • followersUrl

        @Nullable
        public URI followersUrl()
        Followers URL.
        Specified by:
        followersUrl in interface User
      • followingUrl

        @Nullable
        public String followingUrl()
        Following URL template.
        Specified by:
        followingUrl in interface User
      • gistsUrl

        @Nullable
        public String gistsUrl()
        Gists URL template.
        Specified by:
        gistsUrl in interface User
      • starredUrl

        @Nullable
        public String starredUrl()
        Starred URL template.
        Specified by:
        starredUrl in interface User
      • subscriptionsUrl

        @Nullable
        public URI subscriptionsUrl()
        Subscriptions URL.
        Specified by:
        subscriptionsUrl in interface User
      • organizationsUrl

        @Nullable
        public URI organizationsUrl()
        Organizations URL.
        Specified by:
        organizationsUrl in interface User
      • reposUrl

        @Nullable
        public URI reposUrl()
        Repositories URL.
        Specified by:
        reposUrl in interface User
      • eventsUrl

        @Nullable
        public String eventsUrl()
        Events URL template.
        Specified by:
        eventsUrl in interface User
      • receivedEventsUrl

        @Nullable
        public URI receivedEventsUrl()
        Received event URL.
        Specified by:
        receivedEventsUrl in interface User
      • type

        @Nullable
        public String type()
        User type.
        Specified by:
        type in interface User
      • withLogin

        public final ImmutableUser withLogin​(@Nullable
                                             String value)
        Copy the current immutable object by setting a value for the login attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for login (can be null)
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutableUser withId​(@Nullable
                                          Integer value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withAvatarUrl

        public final ImmutableUser withAvatarUrl​(@Nullable
                                                 URI value)
        Copy the current immutable object by setting a value for the avatarUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for avatarUrl (can be null)
        Returns:
        A modified copy of the this object
      • withGravatarId

        public final ImmutableUser withGravatarId​(String value)
        Copy the current immutable object by setting a present value for the optional gravatarId attribute.
        Parameters:
        value - The value for gravatarId
        Returns:
        A modified copy of this object
      • withGravatarId

        public final ImmutableUser withGravatarId​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the gravatarId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for gravatarId
        Returns:
        A modified copy of this object
      • withUrl

        public final ImmutableUser 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
      • withHtmlUrl

        public final ImmutableUser withHtmlUrl​(@Nullable
                                               URI value)
        Copy the current immutable object by setting a value for the htmlUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for htmlUrl (can be null)
        Returns:
        A modified copy of the this object
      • withFollowersUrl

        public final ImmutableUser withFollowersUrl​(@Nullable
                                                    URI value)
        Copy the current immutable object by setting a value for the followersUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for followersUrl (can be null)
        Returns:
        A modified copy of the this object
      • withFollowingUrl

        public final ImmutableUser withFollowingUrl​(@Nullable
                                                    String value)
        Copy the current immutable object by setting a value for the followingUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for followingUrl (can be null)
        Returns:
        A modified copy of the this object
      • withGistsUrl

        public final ImmutableUser withGistsUrl​(@Nullable
                                                String value)
        Copy the current immutable object by setting a value for the gistsUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for gistsUrl (can be null)
        Returns:
        A modified copy of the this object
      • withStarredUrl

        public final ImmutableUser withStarredUrl​(@Nullable
                                                  String value)
        Copy the current immutable object by setting a value for the starredUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for starredUrl (can be null)
        Returns:
        A modified copy of the this object
      • withSubscriptionsUrl

        public final ImmutableUser withSubscriptionsUrl​(@Nullable
                                                        URI value)
        Copy the current immutable object by setting a value for the subscriptionsUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for subscriptionsUrl (can be null)
        Returns:
        A modified copy of the this object
      • withOrganizationsUrl

        public final ImmutableUser withOrganizationsUrl​(@Nullable
                                                        URI value)
        Copy the current immutable object by setting a value for the organizationsUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for organizationsUrl (can be null)
        Returns:
        A modified copy of the this object
      • withReposUrl

        public final ImmutableUser withReposUrl​(@Nullable
                                                URI value)
        Copy the current immutable object by setting a value for the reposUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for reposUrl (can be null)
        Returns:
        A modified copy of the this object
      • withEventsUrl

        public final ImmutableUser withEventsUrl​(@Nullable
                                                 String value)
        Copy the current immutable object by setting a value for the eventsUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for eventsUrl (can be null)
        Returns:
        A modified copy of the this object
      • withReceivedEventsUrl

        public final ImmutableUser withReceivedEventsUrl​(@Nullable
                                                         URI value)
        Copy the current immutable object by setting a value for the receivedEventsUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for receivedEventsUrl (can be null)
        Returns:
        A modified copy of the this object
      • withType

        public final ImmutableUser withType​(@Nullable
                                            String value)
        Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type (can be null)
        Returns:
        A modified copy of the this object
      • withSiteAdmin

        public final ImmutableUser withSiteAdmin​(boolean value)
        Copy the current immutable object by setting a present value for the optional siteAdmin attribute.
        Parameters:
        value - The value for siteAdmin
        Returns:
        A modified copy of this object
      • withSiteAdmin

        public final ImmutableUser withSiteAdmin​(Optional<Boolean> optional)
        Copy the current immutable object by setting an optional value for the siteAdmin attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for siteAdmin
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableUser 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: login, id, avatarUrl, gravatarId, url, htmlUrl, followersUrl, followingUrl, gistsUrl, starredUrl, subscriptionsUrl, organizationsUrl, reposUrl, eventsUrl, receivedEventsUrl, type, siteAdmin.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableUser copyOf​(User instance)
        Creates an immutable copy of a User 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 User instance
      • builder

        public static ImmutableUser.Builder builder()
        Creates a builder for ImmutableUser.
         ImmutableUser.builder()
            .login(String | null) // nullable login
            .id(Integer | null) // nullable id
            .avatarUrl(java.net.URI | null) // nullable avatarUrl
            .gravatarId(String) // optional gravatarId
            .url(java.net.URI | null) // nullable url
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .followersUrl(java.net.URI | null) // nullable followersUrl
            .followingUrl(String | null) // nullable followingUrl
            .gistsUrl(String | null) // nullable gistsUrl
            .starredUrl(String | null) // nullable starredUrl
            .subscriptionsUrl(java.net.URI | null) // nullable subscriptionsUrl
            .organizationsUrl(java.net.URI | null) // nullable organizationsUrl
            .reposUrl(java.net.URI | null) // nullable reposUrl
            .eventsUrl(String | null) // nullable eventsUrl
            .receivedEventsUrl(java.net.URI | null) // nullable receivedEventsUrl
            .type(String | null) // nullable type
            .siteAdmin(Boolean) // optional siteAdmin
            .build();
         
        Returns:
        A new ImmutableUser builder