Record Class UserRoleMetadata

java.lang.Object
java.lang.Record
io.datarouter.auth.model.dto.UserRoleMetadata

public record UserRoleMetadata(Role role, boolean hasRole, Map<RoleApprovalType,RoleApprovalRequirementStatus> requirementStatusByApprovalType, Optional<RoleApprovalType> editorPrioritizedApprovalType, Optional<Boolean> editorCanRevoke, List<String> groupsHasWithRole) extends Record
  • Constructor Details

    • UserRoleMetadata

      public UserRoleMetadata(Role role, boolean hasRole, Map<RoleApprovalType,RoleApprovalRequirementStatus> requirementStatusByApprovalType, Optional<RoleApprovalType> editorPrioritizedApprovalType, Optional<Boolean> editorCanRevoke, List<String> groupsHasWithRole)
      Creates an instance of a UserRoleMetadata record class.
      Parameters:
      role - the value for the role record component
      hasRole - the value for the hasRole record component
      requirementStatusByApprovalType - the value for the requirementStatusByApprovalType record component
      editorPrioritizedApprovalType - the value for the editorPrioritizedApprovalType record component
      editorCanRevoke - the value for the editorCanRevoke record component
      groupsHasWithRole - the value for the groupsHasWithRole record component
  • Method Details

    • getChangeString

      public Optional<String> getChangeString(UserRoleMetadata oldRoleMetaData)
    • toJsDto

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • role

      public Role role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • hasRole

      public boolean hasRole()
      Returns the value of the hasRole record component.
      Returns:
      the value of the hasRole record component
    • requirementStatusByApprovalType

      public Map<RoleApprovalType,RoleApprovalRequirementStatus> requirementStatusByApprovalType()
      Returns the value of the requirementStatusByApprovalType record component.
      Returns:
      the value of the requirementStatusByApprovalType record component
    • editorPrioritizedApprovalType

      public Optional<RoleApprovalType> editorPrioritizedApprovalType()
      Returns the value of the editorPrioritizedApprovalType record component.
      Returns:
      the value of the editorPrioritizedApprovalType record component
    • editorCanRevoke

      public Optional<Boolean> editorCanRevoke()
      Returns the value of the editorCanRevoke record component.
      Returns:
      the value of the editorCanRevoke record component
    • groupsHasWithRole

      public List<String> groupsHasWithRole()
      Returns the value of the groupsHasWithRole record component.
      Returns:
      the value of the groupsHasWithRole record component