Class ImmutableApp

  • All Implemented Interfaces:
    App

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

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

    • Method Detail

      • id

        public Integer id()
        The App ID.
        Specified by:
        id in interface App
        Returns:
        the ID
      • slug

        public Optional<String> slug()
        The URL-friendly name of the GitHub App.
        Specified by:
        slug in interface App
        Returns:
        the optional sting
      • name

        public String name()
        The App name
        Specified by:
        name in interface App
        Returns:
        the string
      • description

        public String description()
        The App Description.
        Specified by:
        description in interface App
        Returns:
        the string
      • externalUrl

        public String externalUrl()
        External url string.
        Specified by:
        externalUrl in interface App
        Returns:
        the string
      • htmlUrl

        public String htmlUrl()
        Html url string.
        Specified by:
        htmlUrl in interface App
        Returns:
        the string
      • createdAt

        public ZonedDateTime createdAt()
        The date the App was created.
        Specified by:
        createdAt in interface App
        Returns:
        the zoned date time
      • updatedAt

        public ZonedDateTime updatedAt()
        The date the App was updated.
        Specified by:
        updatedAt in interface App
        Returns:
        the zoned date time
      • permissions

        public Map<String,​String> permissions()
        The permissions the installation of the app has.
        Specified by:
        permissions in interface App
        Returns:
        the map with permissions
        See Also:
        "https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url -parameters/#github-app-permissions"
      • events

        public List<String> events()
        Events list this App will consume, such as push, pull_request, etc.
        Specified by:
        events in interface App
        Returns:
        the list
      • withId

        public final ImmutableApp withId​(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
        Returns:
        A modified copy of the this object
      • withSlug

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

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

        public final ImmutableApp withName​(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
        Returns:
        A modified copy of the this object
      • withDescription

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

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

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

        public final ImmutableApp withCreatedAt​(ZonedDateTime 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
        Returns:
        A modified copy of the this object
      • withUpdatedAt

        public final ImmutableApp withUpdatedAt​(ZonedDateTime 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
        Returns:
        A modified copy of the this object
      • withPermissions

        public final ImmutableApp withPermissions​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the permissions map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the permissions map
        Returns:
        A modified copy of this object
      • withEvents

        public final ImmutableApp withEvents​(String... elements)
        Copy the current immutable object with elements that replace the content of events.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withEvents

        public final ImmutableApp withEvents​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of events. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of events elements to set
        Returns:
        A modified copy of this object
      • withInstallationsCount

        public final ImmutableApp withInstallationsCount​(int value)
        Copy the current immutable object by setting a present value for the optional installationsCount attribute.
        Parameters:
        value - The value for installationsCount
        Returns:
        A modified copy of this object
      • withInstallationsCount

        public final ImmutableApp withInstallationsCount​(Optional<Integer> optional)
        Copy the current immutable object by setting an optional value for the installationsCount 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 installationsCount
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableApp 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: id, slug, name, description, externalUrl, htmlUrl, createdAt, updatedAt, permissions, events, installationsCount.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableApp.Builder builder()
        Creates a builder for ImmutableApp.
         ImmutableApp.builder()
            .id(Integer) // required id
            .slug(String) // optional slug
            .name(String) // required name
            .description(String) // required description
            .externalUrl(String) // required externalUrl
            .htmlUrl(String) // required htmlUrl
            .createdAt(java.time.ZonedDateTime) // required createdAt
            .updatedAt(java.time.ZonedDateTime) // required updatedAt
            .putPermissions|putAllPermissions(String => String) // permissions mappings
            .addEvents|addAllEvents(String) // events elements
            .installationsCount(Integer) // optional installationsCount
            .build();
         
        Returns:
        A new ImmutableApp builder