Class ImmutableFolderContent

  • All Implemented Interfaces:
    ShaLink, FolderContent

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

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

    • Method Detail

      • sha

        @Nullable
        public String sha()
        SHA.
        Specified by:
        sha in interface ShaLink
      • url

        @Nullable
        public URI url()
        URL.
        Specified by:
        url in interface ShaLink
      • type

        @Nullable
        public String type()
        Content type. E.g file, dir, symlink, submodule
        Specified by:
        type in interface FolderContent
      • name

        @Nullable
        public String name()
        Content name. E.g. file name
        Specified by:
        name in interface FolderContent
      • withSha

        public final ImmutableFolderContent withSha​(@Nullable
                                                    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 (can be null)
        Returns:
        A modified copy of the this object
      • withUrl

        public final ImmutableFolderContent 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
      • withType

        public final ImmutableFolderContent 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
      • withSize

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

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

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

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

        public final ImmutableFolderContent 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
      • withDownloadUrl

        public final ImmutableFolderContent withDownloadUrl​(@Nullable
                                                            URI value)
        Copy the current immutable object by setting a value for the downloadUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for downloadUrl (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 ImmutableFolderContent 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, url, type, size, name, path, gitUrl, htmlUrl, downloadUrl.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableFolderContent.Builder builder()
        Creates a builder for ImmutableFolderContent.
         ImmutableFolderContent.builder()
            .sha(String | null) // nullable sha
            .url(java.net.URI | null) // nullable url
            .type(String | null) // nullable type
            .size(Integer | null) // nullable size
            .name(String | null) // nullable name
            .path(String | null) // nullable path
            .gitUrl(java.net.URI | null) // nullable gitUrl
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .downloadUrl(java.net.URI | null) // nullable downloadUrl
            .build();
         
        Returns:
        A new ImmutableFolderContent builder