Class GenUtils

java.lang.Object
io.micronaut.inject.writer.GenUtils

@Internal public final class GenUtils extends Object
The expressions utils.
Since:
4.8
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.micronaut.sourcegen.model.ExpressionDef
    listOf(List<io.micronaut.sourcegen.model.ExpressionDef> values)
    The list of expression.
    static io.micronaut.sourcegen.model.ExpressionDef
    The list of string expression.
    static io.micronaut.sourcegen.model.ExpressionDef
    mapEntry(io.micronaut.sourcegen.model.ExpressionDef key, io.micronaut.sourcegen.model.ExpressionDef value)
    The map entry expression.
    static <T> io.micronaut.sourcegen.model.ExpressionDef
    stringMapOf(@NonNull Map<? extends CharSequence,T> map, boolean skipEmpty, T empty, @NonNull Function<T,io.micronaut.sourcegen.model.ExpressionDef> objAsExpression)
    Create a map of a string key expression.
    static <T> io.micronaut.sourcegen.model.ExpressionDef
    stringMapOf(@NonNull Map<? extends CharSequence,T> map, boolean skipEmpty, T empty, @Nullable Predicate<T> valuePredicate, @NonNull Function<T,io.micronaut.sourcegen.model.ExpressionDef> objAsExpression)
    Create a map of a string key expression.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • stringMapOf

      public static <T> io.micronaut.sourcegen.model.ExpressionDef stringMapOf(@NonNull @NonNull Map<? extends CharSequence,T> map, boolean skipEmpty, @Nullable T empty, @NonNull @NonNull Function<T,io.micronaut.sourcegen.model.ExpressionDef> objAsExpression)
      Create a map of a string key expression.
      Type Parameters:
      T - The value type
      Parameters:
      map - The map
      skipEmpty - Should skip empty value entry
      empty - Replace the empty entry value with
      objAsExpression - The object to expression mapper
      Returns:
      The expression
    • stringMapOf

      public static <T> io.micronaut.sourcegen.model.ExpressionDef stringMapOf(@NonNull @NonNull Map<? extends CharSequence,T> map, boolean skipEmpty, @Nullable T empty, @Nullable @Nullable Predicate<T> valuePredicate, @NonNull @NonNull Function<T,io.micronaut.sourcegen.model.ExpressionDef> objAsExpression)
      Create a map of a string key expression.
      Type Parameters:
      T - The value type
      Parameters:
      map - The map
      skipEmpty - Should skip empty value entry
      empty - Replace the empty entry value with
      valuePredicate - The value predicate
      objAsExpression - The object to expression mapper
      Returns:
      The expression
    • mapEntry

      public static io.micronaut.sourcegen.model.ExpressionDef mapEntry(io.micronaut.sourcegen.model.ExpressionDef key, io.micronaut.sourcegen.model.ExpressionDef value)
      The map entry expression.
      Parameters:
      key - The key
      value - The value
      Returns:
      the expression
    • listOfString

      public static io.micronaut.sourcegen.model.ExpressionDef listOfString(List<String> strings)
      The list of string expression.
      Parameters:
      strings - The strings
      Returns:
      the expression
    • listOf

      public static io.micronaut.sourcegen.model.ExpressionDef listOf(List<io.micronaut.sourcegen.model.ExpressionDef> values)
      The list of expression.
      Parameters:
      values - The values
      Returns:
      the expression