static Set mapToAllowedOperationsTypeSet()

in service/src/main/java/org/apache/fineract/cn/identity/internal/mapper/PermissionMapper.java [35:52]


  static Set<AllowedOperationType> mapToAllowedOperationsTypeSet(
          @Nullable final Set<AllowedOperation> allowedOperations) {
    if (allowedOperations == null)
      return Collections.emptySet();

    return allowedOperations.stream().map(op -> {
      switch (op) {
        case READ:
          return AllowedOperationType.READ;
        case CHANGE:
          return AllowedOperationType.CHANGE;
        case DELETE:
          return AllowedOperationType.DELETE;
        default:
          return null;
      }
    }).filter(op -> (op != null)).collect(Collectors.toSet());
  }