Class TypeNameFormat
java.lang.Object
no.sikt.graphitron.generators.codebuilding.TypeNameFormat
Helper methods for handling javapoet TypeNames.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassNamegetGeneratedClassName(String subPath, String name) static ParameterizedTypeNamestatic ParameterizedTypeNamestatic ParameterizedTypeNamewrapArrayList(TypeName type) static ParameterizedTypeNamewrapFetcher(TypeName type) static ParameterizedTypeNamewrapFuture(TypeName type) static ParameterizedTypeNamestatic TypeNamewrapListIf(TypeName type, boolean condition) static ParameterizedTypeNamestatic ParameterizedTypeNamestatic TypeNamestatic ParameterizedTypeNamewrapStringMap(TypeName type) static TypeNamewrapStringMapIf(TypeName type, boolean condition)
-
Constructor Details
-
TypeNameFormat
public TypeNameFormat()
-
-
Method Details
-
wrapListIf
- Returns:
- The type wrapped in a List ParameterizedTypeName, if the boolean condition is true.
-
wrapSetIf
- Returns:
- The type wrapped in a Set ParameterizedTypeName, if the boolean condition is true.
-
wrapStringMapIf
- Returns:
- The type wrapped in a Map ParameterizedTypeName with String as key, if the boolean condition is true.
-
wrapList
- Returns:
- The type wrapped in a List ParameterizedTypeName.
-
wrapArrayList
- Returns:
- The type wrapped in a ArrayList ParameterizedTypeName.
-
wrapSet
- Returns:
- The type wrapped in a Set ParameterizedTypeName.
-
wrapFuture
- Returns:
- The type wrapped in a CompletableFuture ParameterizedTypeName.
-
wrapFetcher
- Returns:
- The type wrapped in a DataFetcher ParameterizedTypeName.
-
wrapStringMap
- Returns:
- The type wrapped in a Map ParameterizedTypeName with String as key.
-
wrapMap
- Returns:
- The type wrapped in a Map ParameterizedTypeName with key.
-
getStringSetTypeName
- Returns:
- The ParameterizedTypeName for a Set of Strings.
-
getObjectMapTypeName
- Returns:
- The ParameterizedTypeName for a Map of Objects by Strings.
-
getGeneratedClassName
- Parameters:
subPath- Path from the top of the output package.name- Name of the class.- Returns:
- ClassName based on the default output package and the provided subpath.
-