src/main/java/org/odessajavaclub/user/adapter/in/rest/mapper/UserRoleRestMapper.java
public String asRole(UserRole userRole) {
    if (userRole == null) {
      return null;
    }
    switch (userRole) {
      case ADMIN:
        return "admin";
      case USER:
        return "user";
      case READONLY:
        return "readonly";
      default:
        throw new IllegalArgumentException("Unknown user role: " + userRole);
    }
  }
/**
   * Maps {@link UserRole} to its string representation.
   *
   * @param userRole {@link UserRole}
   * @return user role string representation
   */
Maps  UserRole to its string representation.
@param userRole  UserRole
@return user role string representation
Maps UserRole to its string representation . @param userRole UserRole @return user role string representation
public String asRole(UserRole userRole) {
    if (userRole == null) {
      return null;
    }
    switch (userRole) {
      case ADMIN:
        return "admin";
      case USER:
        return "user";
      case READONLY:
        return "readonly";
      default:
        throw new IllegalArgumentException("Unknown user role: " + userRole);
    }
  }
public String asRole ( UserRole userRole ) { if ( userRole == null ) { return null ; } switch ( userRole ) { case ADMIN : return "admin" ; case USER : return "user" ; case READONLY : return "readonly" ; default : throw new IllegalArgumentException ( "Unknown user role: " + userRole ) ; } }
Maps {@link UserRole} to its string representation.
Maps { @link UserRole } to its string representation .