Class NameFormat
java.lang.Object
no.sikt.graphitron.generators.codebuilding.NameFormat
Helper methods for formatting names.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringasCountMethodName(String field, String container) static Stringstatic @NotNull StringasEntityQueryMethodName(String prefix) static @NotNull StringasGetMethodName(String field) static @NotNull StringasGetMethodName(String field, String type) static @NotNull StringasGetMethodVariableName(String source, String fieldName) static @NotNull Stringstatic @NotNull StringasListedNameIf(String s, boolean condition) static @NotNull StringasListedRecordName(String name) static @NotNull StringasListedRecordNameIf(String name, boolean condition) static @NotNull Stringstatic @NotNull Stringstatic @NotNull StringasQueryMethodName(String field, String container) static @NotNull StringasRecordMapperClass(String s, boolean isJavaRecord, boolean isInput) static @NotNull Stringstatic @NotNull StringasTypeResolverMethodName(String target) static StringinterfaceOrUnionQueryName(String implementationName, String interfaceName) static @NotNull StringnamedIteratorPrefixIf(String s, boolean condition) static @NotNull StringrecordTransformMethod(boolean isJavaRecord, boolean isInput) static @NotNull StringrecordTransformMethod(String s, boolean isJavaRecord, boolean isInput) static @NotNull Stringstatic StringtoCamelCase(String name) Camel case conversion with special handling for numbers.
-
Field Details
-
PREFIX_COUNT
- See Also:
-
PREFIX_GET
- See Also:
-
SUFFIX_LIST
- See Also:
-
PREFIX_VALIDATE
- See Also:
-
SUFFIX_RECORD
- See Also:
-
SUFFIX_RECORD_TRANSFORM
- See Also:
-
SUFFIX_RECORD_TRANSFORM_JAVA
- See Also:
-
SUFFIX_RESPONSE_TRANSFORM
- See Also:
-
SUFFIX_RESPONSE_TRANSFORM_JOOQ
- See Also:
-
SUFFIX_RESPONSE_TRANSFORM_JAVA
- See Also:
-
SUFFIX_TYPE_RESOLVER
- See Also:
-
SUFFIX_RESOLVER_KEY_DTO
- See Also:
-
-
Constructor Details
-
NameFormat
public NameFormat()
-
-
Method Details
-
asGetMethodVariableName
- Returns:
- Inputs formatted as a get call, but without the get element of the string.
-
asCountMethodName
- Returns:
- This field and containing type formatted as a counting query method name.
-
asQueryMethodName
- Returns:
- This field and containing type formatted as a fetch query method name.
-
asEntityQueryMethodName
- Returns:
- This field and containing type formatted as an entity fetch query method name.
-
asTypeResolverMethodName
- Returns:
- Format this name as a method name for a type resolver.
-
asGetMethodName
- Returns:
- Inputs formatted as a get call.
-
asGetMethodName
- Returns:
- Inputs formatted as a get call.
-
asQueryClass
- Returns:
- Name formatted as a query class name.
-
asRecordMapperClass
@NotNull public static @NotNull String asRecordMapperClass(String s, boolean isJavaRecord, boolean isInput) - Returns:
- Name formatted as a record mapper class name.
-
interfaceOrUnionQueryName
- Returns:
- Interface method naming for this interface implementation.
-
asNodeQueryName
- Returns:
- Field type formatted as a node interface method call.
-
asEntitiesQueryName
-
asListedName
- Returns:
- Input formatted as a list version of itself.
-
asListedNameIf
- Returns:
- Input formatted as a list version of itself, if condition is true.
-
asRecordName
- Returns:
- Format this string as a record naming pattern.
-
recordTransformMethod
@NotNull public static @NotNull String recordTransformMethod(String s, boolean isJavaRecord, boolean isInput) - Returns:
- Format this string as a record transform method naming pattern.
-
recordTransformMethod
- Returns:
- Format a record transform method naming pattern.
-
recordValidateMethod
- Returns:
- Format a record validation method naming pattern.
-
namedIteratorPrefixIf
- Returns:
- Input formatted as an iterable name, if condition is true.
-
asListedRecordName
- Returns:
- Format this string as an iterable record naming pattern.
-
asListedRecordNameIf
- Returns:
- Format this string as a record naming pattern. It is iterable if condition is set to true
-
toCamelCase
Camel case conversion with special handling for numbers.
-