Interface AotRepositoryConstructorBuilder.ParameterOrigin
- Enclosing interface:
AotRepositoryConstructorBuilder
public static interface AotRepositoryConstructorBuilder.ParameterOrigin
Interface describing the origin of a constructor parameter. The parameter value can be obtained either from a
reference variable, a code block or a combination of both.- Since:
- 4.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.javapoet.CodeBlockObtain the code block to obtain the parameter value from.@Nullable StringObtain the reference name to obtain the parameter value from.Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlockand reference name.of(org.springframework.javapoet.CodeBlock codeBlock) Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlock.ofReference(String reference) Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the given reference name.
-
Method Details
-
of
static AotRepositoryConstructorBuilder.ParameterOrigin of(String reference, org.springframework.javapoet.CodeBlock codeBlock) Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlockand reference name.- Parameters:
reference- the reference name to obtain the parameter value from.codeBlock- the code block that is required to set up the parameter value.- Returns:
- a
AotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlockand reference name.
-
of
static AotRepositoryConstructorBuilder.ParameterOrigin of(org.springframework.javapoet.CodeBlock codeBlock) Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlock.- Parameters:
codeBlock- the code block that produces the parameter value.- Returns:
- a
AotRepositoryConstructorBuilder.ParameterOriginfrom the givenCodeBlock.
-
ofReference
Construct aAotRepositoryConstructorBuilder.ParameterOriginfrom the given reference name.- Parameters:
reference- the reference name of the variable to obtain the parameter value from.- Returns:
- a
AotRepositoryConstructorBuilder.ParameterOriginfrom the given reference name.
-
getReference
@Nullable String getReference()Obtain the reference name to obtain the parameter value from. Can be null if the parameter value is solely obtained from thecode block.- Returns:
- name of the reference or null if absent.
-
getCodeBlock
org.springframework.javapoet.CodeBlock getCodeBlock()Obtain the code block to obtain the parameter value from. Never null, can be empty.
-