public List create()

in src/main/java/com/epam/digital/data/platform/generator/factory/impl/asyncload/KafkaApiArrayEntityScopeFactory.java [46:72]


  public List<ModelScope> create(Context context) {
    return asyncDataLoadInfoProvider.getTablesWithAsyncLoad().entrySet().stream()
        .map(
            tableEntry -> {
              var scope = new ModelScope();
              var schemaName = getSchemaName(tableEntry.getKey(), context);
              scope.setClassName(schemaName + "ModelArrayCsv");

              var field = new Field();
              field.setName("entities");
              field.setType(
                  ScopeTypeUtils.getArrayOfType(schemaName + getSchemaSuffix(tableEntry.getKey())));
              String maxSize = tableEntry.getValue();
              field.setConstraints(
                  List.of(
                      new Constraint(
                          "@javax.validation.constraints.NotNull", Collections.emptyList()),
                      new Constraint(
                          "@javax.validation.constraints.Size",
                          List.of(new Content("max", maxSize),
                              new Content("message", "\"Maximum list size - " + maxSize + "\""))),
                      new Constraint("@javax.validation.Valid", Collections.emptyList())));
              scope.getFields().add(field);
              return scope;
            })
        .collect(toList());
  }