Class NameFormat
java.lang.Object
no.sikt.graphitron.generators.codebuilding.NameFormat
Helper methods for formatting names.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringasContextFieldName(String name) static @NotNull StringasCountMethodName(String field, String container) static @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 StringasInternalName(String name) static @NotNull StringasIterable(String s) static @NotNull StringasIterableIf(String s, boolean condition) static @NotNull Stringstatic @NotNull StringasIterableResultNameIf(String s, boolean condition) 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 Stringstatic @NotNull StringasRecordMapperClass(String s, boolean isJavaRecord, boolean isInput) static @NotNull Stringstatic @NotNull Stringstatic @NotNull StringasTypeResolverMethodName(String target) static StringinterfaceQueryName(String implementationName, String interfaceName) 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
-
VARIABLE_COUNT_PREFIX
- See Also:
-
VARIABLE_GET_PREFIX
- See Also:
-
VARIABLE_RESULT_SUFFIX
- See Also:
-
VARIABLE_LIST_SUFFIX
- See Also:
-
VARIABLE_ITERATE_PREFIX
- See Also:
-
RECORD_NAME_SUFFIX
- See Also:
-
INDEX_NAME_SUFFIX
- See Also:
-
RECORD_TRANSFORM_SUFFIX
- See Also:
-
RECORD_TRANSFORM_JAVA_SUFFIX
- See Also:
-
RESPONSE_TRANSFORM_SUFFIX
- See Also:
-
RESPONSE_TRANSFORM_JOOQ_SUFFIX
- See Also:
-
RESPONSE_TRANSFORM_JAVA_SUFFIX
- See Also:
-
VALIDATE_PREFIX
- See Also:
-
TYPE_RESOLVER_SUFFIX
- See Also:
-
RESOLVER_KEY_DTO_SUFFIX
- See Also:
-
-
Constructor Details
-
NameFormat
public NameFormat()
-
-
Method Details
-
asInternalName
- Returns:
- Format this name to not block schema namespace.
-
asContextFieldName
- Returns:
- Format this name to not block schema namespace.
-
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.
-
interfaceQueryName
- Returns:
- Interface method naming for this interface implementation.
-
asNodeQueryName
- Returns:
- Field type formatted as a node interface method call.
-
asListedName
- Returns:
- Input formatted as a list version of itself.
-
asListedNameIf
- Returns:
- Input formatted as a list version of itself, if condition is true.
-
asResultName
- Returns:
- Input formatted as a result name.
-
asRecordName
- Returns:
- Format this string as a record naming pattern.
-
asRecordClassName
- Returns:
- Format this string as a record class naming pattern.
-
asIndexName
- Returns:
- Format this string as an index 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.
-
asIterable
- Returns:
- Input formatted as an iterable name.
-
asIterableIf
- Returns:
- Input formatted as an iterable name, if condition is true.
-
asIterableResultName
- Returns:
- Input formatted as an iterable result name.
-
asIterableResultNameIf
- Returns:
- Input formatted as a result name. It is iterable if condition is set to 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.
-