Interface ColumnTemplate<T>

Type Parameters:
T - the column type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ColumnTemplate<T>
Specifies a reusable column configuration.
ColumnTemplate<String> REQUIRED_SEARCHABLE =
        column -> column.as()
                .column()
                .nullable(false)
                .searchable(true);

Customer.LASTNAME.as(REQUIRED_SEARCHABLE)
        .maximumLength(20);

A template configures the column from the ground up, so it is free to use any Column.ColumnDefiner method, a subquery or primary key column is templated just like a regular one.

static ColumnTemplate<Integer> count(String subquery) {
  return column -> column.as()
          .subquery(subquery)
          .numberGrouping(true);
}

Templates compose by applying the one being extended.

ColumnTemplate<String> NAME =
        column -> column.as()
                .column()
                .maximumLength(120)
                .searchable(true);

ColumnTemplate<String> REQUIRED_NAME =
        column -> NAME.apply(column)
                .nullable(false);
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(Column<T> column)
    Applies this template to the given column