Class LordOfTheStrings.ReturnBuilderSupport
java.lang.Object
org.springframework.data.javapoet.LordOfTheStrings.ReturnBuilderSupport
- Direct Known Subclasses:
LordOfTheStrings.TypedReturnBuilder
- Enclosing class:
LordOfTheStrings
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.javapoet.CodeBlockbuild()Build the code block representing the return statement.Add a fallback return statement if no previous return statement was added.Add a return statement if the given condition istrue.
-
Method Details
-
when
@Contract("_, _, _ -> this") public LordOfTheStrings.ReturnBuilderSupport when(boolean condition, String format, @Nullable Object... args) Add a return statement if the given condition istrue.- Parameters:
condition- the condition to evaluate.format- the code format string.args- the format arguments.- Returns:
thisbuilder.
-
otherwise
@Contract("_, _ -> this") public LordOfTheStrings.ReturnBuilderSupport otherwise(String format, @Nullable Object... args) Add a fallback return statement if no previous return statement was added.- Parameters:
format- the code format string.args- the format arguments.- Returns:
thisbuilder.
-
build
Build the code block representing the return statement.- Returns:
- the resulting
CodeBlock
-