Class ImmutableMilestone

  • All Implemented Interfaces:
    CloseTracking, UpdateTracking, Milestone

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

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

    • Method Detail

      • url

        @Nullable
        public URI url()
        URL
        Specified by:
        url in interface Milestone
      • htmlUrl

        @Nullable
        public URI htmlUrl()
        HTML URL
        Specified by:
        htmlUrl in interface Milestone
      • labelsUrl

        @Nullable
        public URI labelsUrl()
        Labels URL
        Specified by:
        labelsUrl in interface Milestone
      • state

        @Nullable
        public String state()
        The state of the milestone. Either open, closed, or all.
        Specified by:
        state in interface Milestone
      • creator

        @Nullable
        public User creator()
        Creator user
        Specified by:
        creator in interface Milestone
      • withCreatedAt

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

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

        public final ImmutableMilestone withClosedAt​(GitHubInstant value)
        Copy the current immutable object by setting a present value for the optional closedAt attribute.
        Parameters:
        value - The value for closedAt
        Returns:
        A modified copy of this object
      • withClosedAt

        public final ImmutableMilestone withClosedAt​(Optional<? extends GitHubInstant> optional)
        Copy the current immutable object by setting an optional value for the closedAt attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for closedAt
        Returns:
        A modified copy of this object
      • withUrl

        public final ImmutableMilestone 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 ImmutableMilestone 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
      • withLabelsUrl

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

        public final ImmutableMilestone 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
      • withNumber

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

        public final ImmutableMilestone 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
      • withTitle

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

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

        public final ImmutableMilestone withDescription​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the description 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 description
        Returns:
        A modified copy of this object
      • withCreator

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

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

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

        public final ImmutableMilestone withDueOn​(GitHubInstant value)
        Copy the current immutable object by setting a present value for the optional dueOn attribute.
        Parameters:
        value - The value for dueOn
        Returns:
        A modified copy of this object
      • withDueOn

        public final ImmutableMilestone withDueOn​(Optional<? extends GitHubInstant> optional)
        Copy the current immutable object by setting an optional value for the dueOn attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for dueOn
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableMilestone 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: createdAt, updatedAt, closedAt, url, htmlUrl, labelsUrl, id, number, state, title, description, creator, openIssues, closedIssues, dueOn.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableMilestone.Builder builder()
        Creates a builder for ImmutableMilestone.
         ImmutableMilestone.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .closedAt(com.spotify.github.GitHubInstant) // optional closedAt
            .url(java.net.URI | null) // nullable url
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .labelsUrl(java.net.URI | null) // nullable labelsUrl
            .id(Integer | null) // nullable id
            .number(Integer | null) // nullable number
            .state(String | null) // nullable state
            .title(String | null) // nullable title
            .description(String) // optional description
            .creator(com.spotify.github.v3.User | null) // nullable creator
            .openIssues(Integer | null) // nullable openIssues
            .closedIssues(Integer | null) // nullable closedIssues
            .dueOn(com.spotify.github.GitHubInstant) // optional dueOn
            .build();
         
        Returns:
        A new ImmutableMilestone builder