Package io.micronaut.inject.writer
Class GenUtils
java.lang.Object
io.micronaut.inject.writer.GenUtils
The expressions utils.
- Since:
- 4.8
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.micronaut.sourcegen.model.ExpressionDefThe list of expression.static io.micronaut.sourcegen.model.ExpressionDeflistOfString(List<String> strings) The list of string expression.static io.micronaut.sourcegen.model.ExpressionDefmapEntry(io.micronaut.sourcegen.model.ExpressionDef key, io.micronaut.sourcegen.model.ExpressionDef value) The map entry expression.static <T> io.micronaut.sourcegen.model.ExpressionDefstringMapOf(@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.ExpressionDefstringMapOf(@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.
-
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 mapskipEmpty- Should skip empty value entryempty- Replace the empty entry value withobjAsExpression- 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 mapskipEmpty- Should skip empty value entryempty- Replace the empty entry value withvaluePredicate- The value predicateobjAsExpression- 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 keyvalue- The value- Returns:
- the expression
-
listOfString
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
-