Class ImmutablePermissionValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutablePermissionValue
All Implemented Interfaces:
AuthorizationRecordValue.PermissionValue

public final class ImmutablePermissionValue extends Object implements AuthorizationRecordValue.PermissionValue
Immutable implementation of AuthorizationRecordValue.PermissionValue.

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

  • Method Details

    • getPermissionType

      public PermissionType getPermissionType()
      Returns the type of permission for the resourceIds in this object
      Specified by:
      getPermissionType in interface AuthorizationRecordValue.PermissionValue
    • getResourceIds

      public List<String> getResourceIds()
      Returns the resourceIds of this permission
      Specified by:
      getResourceIds in interface AuthorizationRecordValue.PermissionValue
    • withPermissionType

      public final ImmutablePermissionValue withPermissionType(PermissionType value)
      Copy the current immutable object by setting a value for the permissionType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for permissionType (can be null)
      Returns:
      A modified copy of the this object
    • withResourceIds

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutablePermissionValue that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Returns a lazily computed hash code from attributes: permissionType, resourceIds.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a AuthorizationRecordValue.PermissionValue 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 PermissionValue instance
    • builder

      public static ImmutablePermissionValue.Builder builder()
      Creates a builder for ImmutablePermissionValue.
       ImmutablePermissionValue.builder()
          .withPermissionType(io.camunda.zeebe.protocol.record.value.PermissionType | null) // nullable permissionType
          .addResourceId|addAllResourceIds(String) // resourceIds elements
          .build();
       
      Returns:
      A new ImmutablePermissionValue builder