BestSolution.at public p2 repository
Util
at.bestsolution.framework.grid

Class Util

  • java.lang.Object
    • at.bestsolution.framework.grid.Util


  • public class Util
    extends java.lang.Object
    Utility methods
    Since:
    1.0
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • emptySelection

        public static <R> @NonNull XSelection<R> emptySelection()
        Type Parameters:
        R - the row type
        Returns:
        an empty selection
      • emptyCellSelection

        public static <R> @NonNull XCellSelection<R> emptyCellSelection()
        Type Parameters:
        R - the row type
        Returns:
        an empty cell selection
      • nullCellDataFunction

        public static <R,C,D> @NonNull CellDataFunction<R,C,D> nullCellDataFunction()
        Type Parameters:
        R - the row type
        C - the cell type
        D - the expected return type
        Returns:
        cell data function who always return null
      • defaultToStringCellDataFunction

        public static <R,C> @NonNull CellDataFunction<R,C,java.lang.CharSequence> defaultToStringCellDataFunction()
        Type Parameters:
        R - the row type
        C - the cell type
        Returns:
        cell data function who returns the toString value of the cell value or null
      • defaultToStringMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultToStringMatcher()
        Type Parameters:
        R - the row type
        C - the cell type
        O - the filter value type
        Returns:
        matcher function which compares the string value
      • defaultSubstringMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultSubstringMatcher(@NonNull Property<CellDataFunction<R,C,java.lang.CharSequence>> textFunctionProperty)
        Type Parameters:
        R - the row type
        C - the cell type
        O - the filter value type
        Parameters:
        textFunctionProperty - the columns textValueFunction property
        Returns:
        matcher function which checks whether the filter value is a substring of the cell value
      • defaultTrueMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultTrueMatcher()
        Type Parameters:
        R - the row type
        C - the cell type
        O - the filter value type
        Returns:
        matcher function which always matches. Use this for "All".
      • defaultEmptyMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultEmptyMatcher(@NonNull Property<CellDataFunction<R,C,java.lang.CharSequence>> textFunctionProperty)
        Type Parameters:
        R - the row type
        C - the cell type
        O - the filter value type
        Parameters:
        textFunctionProperty - the columns textValueFunction property
        Returns:
        matcher function which matches for null or empty String.toString() values
      • defaultNotEmptyMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultNotEmptyMatcher(@NonNull Property<CellDataFunction<R,C,java.lang.CharSequence>> textFunctionProperty)
        Type Parameters:
        R - the row type
        C - the cell type
        O - the filter value type
        Parameters:
        textFunctionProperty - the columns textValueFunction property
        Returns:
        matcher function which matches for not null and not empty String.toString() values
      • defaultBooleanTrueMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultBooleanTrueMatcher()
        Returns:
        matcher which matches the domain value to true
      • defaultBooleanNotTrueMatcher

        public static <R,C,O> @NonNull CellValueMatcherFunction<R,C,O> defaultBooleanNotTrueMatcher()
        Returns:
        matcher which matches the domain as the opposite of true
      • emptyListSupplier

        public static <O> @NonNull java.util.function.Supplier<java.util.List<O>> emptyListSupplier()
        Type Parameters:
        O - the list element type
        Returns:
        supplier of empty list
      • defaultToStringFunction

        public static <O> @NonNull java.util.function.Function<O,java.lang.CharSequence> defaultToStringFunction()
        Type Parameters:
        O - the value type
        Returns:
        to string representation of value
      • defaultElementComparer

        public static <R> @NonNull ElementComparer<R> defaultElementComparer()
        Returns:
        a default ElementComparer which uses default implementations of Object.equals(Object) and Object.hashCode()