Class ImmutableAccessPermission

  • All Implemented Interfaces:
    AccessPermission

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

    Use the builder to create immutable instances: ImmutableAccessPermission.builder(). Use the static factory method to create immutable instances: ImmutableAccessPermission.of().

    • Method Detail

      • name

        public String name()
        The name of the permission relative to its PermissionKind.
        Specified by:
        name in interface AccessPermission
      • withName

        public final ImmutableAccessPermission 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
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableAccessPermission 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: name.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableAccessPermission of​(String name)
        Construct a new immutable AccessPermission instance.
        Parameters:
        name - The value for the name attribute
        Returns:
        An immutable AccessPermission instance
      • copyOf

        public static ImmutableAccessPermission copyOf​(AccessPermission instance)
        Creates an immutable copy of a AccessPermission 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 AccessPermission instance