Class ImmutablePermissions

  • All Implemented Interfaces:
    Permissions

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

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

    • Method Detail

      • withAdmin

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

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

        public final ImmutablePermissions withPull​(@Nullable
                                                   Boolean value)
        Copy the current immutable object by setting a value for the pull attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for pull (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 ImmutablePermissions 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: admin, push, pull.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutablePermissions.Builder builder()
        Creates a builder for ImmutablePermissions.
         ImmutablePermissions.builder()
            .admin(Boolean | null) // nullable admin
            .push(Boolean | null) // nullable push
            .pull(Boolean | null) // nullable pull
            .build();
         
        Returns:
        A new ImmutablePermissions builder