Class ImmutableFileItem

  • All Implemented Interfaces:
    FileItem

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

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

    • Method Detail

      • sha

        public String sha()
        Commit sha value.
        Specified by:
        sha in interface FileItem
      • status

        @Nullable
        public String status()
        Commit API URL.
        Specified by:
        status in interface FileItem
      • additions

        @Nullable
        public Integer additions()
        Specified by:
        additions in interface FileItem
        Returns:
        The value of the additions attribute
      • changes

        @Nullable
        public Integer changes()
        Specified by:
        changes in interface FileItem
        Returns:
        The value of the changes attribute
      • blobUrl

        @Nullable
        public URI blobUrl()
        Specified by:
        blobUrl in interface FileItem
        Returns:
        The value of the blobUrl attribute
      • rawUrl

        @Nullable
        public URI rawUrl()
        Specified by:
        rawUrl in interface FileItem
        Returns:
        The value of the rawUrl attribute
      • contentsUrl

        @Nullable
        public URI contentsUrl()
        Specified by:
        contentsUrl in interface FileItem
        Returns:
        The value of the contentsUrl attribute
      • patch

        @Nullable
        public String patch()
        Specified by:
        patch in interface FileItem
        Returns:
        The value of the patch attribute
      • withSha

        public final ImmutableFileItem withSha​(String value)
        Copy the current immutable object by setting a value for the sha attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for sha
        Returns:
        A modified copy of the this object
      • withFilename

        public final ImmutableFileItem withFilename​(String value)
        Copy the current immutable object by setting a value for the filename attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for filename
        Returns:
        A modified copy of the this object
      • withStatus

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

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

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

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

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

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

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

        public final ImmutableFileItem withPatch​(@Nullable
                                                 String value)
        Copy the current immutable object by setting a value for the patch attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for patch (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 ImmutableFileItem 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: sha, filename, status, additions, deletions, changes, blobUrl, rawUrl, contentsUrl, patch.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableFileItem.Builder builder()
        Creates a builder for ImmutableFileItem.
         ImmutableFileItem.builder()
            .sha(String) // required sha
            .filename(String) // required filename
            .status(String | null) // nullable status
            .additions(Integer | null) // nullable additions
            .deletions(Integer | null) // nullable deletions
            .changes(Integer | null) // nullable changes
            .blobUrl(java.net.URI | null) // nullable blobUrl
            .rawUrl(java.net.URI | null) // nullable rawUrl
            .contentsUrl(java.net.URI | null) // nullable contentsUrl
            .patch(String | null) // nullable patch
            .build();
         
        Returns:
        A new ImmutableFileItem builder