Class ImmutableAuthorizationRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableAuthorizationRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, AuthorizationRecordValue

public final class ImmutableAuthorizationRecordValue extends Object implements AuthorizationRecordValue
Immutable implementation of AuthorizationRecordValue.

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

  • Method Details

    • getAction

      public PermissionAction getAction()
      Specified by:
      getAction in interface AuthorizationRecordValue
      Returns:
      The value of the action attribute
    • getOwnerKey

      public Long getOwnerKey()
      Specified by:
      getOwnerKey in interface AuthorizationRecordValue
      Returns:
      The value of the ownerKey attribute
    • getOwnerType

      public AuthorizationOwnerType getOwnerType()
      Specified by:
      getOwnerType in interface AuthorizationRecordValue
      Returns:
      The value of the ownerType attribute
    • getResourceType

      public AuthorizationResourceType getResourceType()
      Specified by:
      getResourceType in interface AuthorizationRecordValue
      Returns:
      The value of the resourceType attribute
    • getPermissions

      Specified by:
      getPermissions in interface AuthorizationRecordValue
      Returns:
      The value of the permissions attribute
    • withAction

      public final ImmutableAuthorizationRecordValue withAction(PermissionAction value)
      Copy the current immutable object by setting a value for the action attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for action (can be null)
      Returns:
      A modified copy of the this object
    • withOwnerKey

      public final ImmutableAuthorizationRecordValue withOwnerKey(Long value)
      Copy the current immutable object by setting a value for the ownerKey attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ownerKey (can be null)
      Returns:
      A modified copy of the this object
    • withOwnerType

      public final ImmutableAuthorizationRecordValue withOwnerType(AuthorizationOwnerType value)
      Copy the current immutable object by setting a value for the ownerType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ownerType (can be null)
      Returns:
      A modified copy of the this object
    • withResourceType

      public final ImmutableAuthorizationRecordValue withResourceType(AuthorizationResourceType value)
      Copy the current immutable object by setting a value for the resourceType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for resourceType (can be null)
      Returns:
      A modified copy of the this object
    • withPermissions

      Copy the current immutable object with elements that replace the content of permissions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPermissions

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableAuthorizationRecordValue 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: action, ownerKey, ownerType, resourceType, permissions.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for ImmutableAuthorizationRecordValue.
       ImmutableAuthorizationRecordValue.builder()
          .withAction(io.camunda.zeebe.protocol.record.value.PermissionAction | null) // nullable action
          .withOwnerKey(Long | null) // nullable ownerKey
          .withOwnerType(io.camunda.zeebe.protocol.record.value.AuthorizationOwnerType | null) // nullable ownerType
          .withResourceType(io.camunda.zeebe.protocol.record.value.AuthorizationResourceType | null) // nullable resourceType
          .addPermission|addAllPermissions(io.camunda.zeebe.protocol.record.value.AuthorizationRecordValue.PermissionValue) // permissions elements
          .build();
       
      Returns:
      A new ImmutableAuthorizationRecordValue builder