Class DefaultColumnToMethodMatchingStrategy
java.lang.Object
com.clickhouse.client.api.metadata.DefaultColumnToMethodMatchingStrategy
- All Implemented Interfaces:
ColumnToMethodMatchingStrategy
public class DefaultColumnToMethodMatchingStrategy
extends Object
implements ColumnToMethodMatchingStrategy
Default implementation of
ColumnToMethodMatchingStrategy takes the following rules:
- Method name is normalized by removing prefixes like "get", "set", "is", "has".
- Column name is normalized by removing special characters like "-", "_", ".".
- Normalized method name and column name are compared case-insensitively.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultColumnToMethodMatchingStrategy(String getterPatternRegEx, String setterPaternRegEx, String methodReplacePatternRegEx, String columnReplacePatternRegEx) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the method is a getter.booleanChecks if the method is a setter.normalizeColumnName(String columnName) Normalizes column name to match method name.normalizeMethodName(String methodName) Normalizes method name to match column name.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultColumnToMethodMatchingStrategy
public DefaultColumnToMethodMatchingStrategy() -
DefaultColumnToMethodMatchingStrategy
-
-
Method Details
-
normalizeMethodName
Description copied from interface:ColumnToMethodMatchingStrategyNormalizes method name to match column name.- Specified by:
normalizeMethodNamein interfaceColumnToMethodMatchingStrategy- Parameters:
methodName- original method name- Returns:
- normalized method name
-
isSetter
Description copied from interface:ColumnToMethodMatchingStrategyChecks if the method is a setter.- Specified by:
isSetterin interfaceColumnToMethodMatchingStrategy- Parameters:
methodName- original (not normalized) method name- Returns:
- true if the method is a setter
-
isGetter
Description copied from interface:ColumnToMethodMatchingStrategyChecks if the method is a getter.- Specified by:
isGetterin interfaceColumnToMethodMatchingStrategy- Parameters:
methodName- original (not normalized) method name- Returns:
- true if the method is a getter
-
normalizeColumnName
Description copied from interface:ColumnToMethodMatchingStrategyNormalizes column name to match method name.- Specified by:
normalizeColumnNamein interfaceColumnToMethodMatchingStrategy- Parameters:
columnName- original column name- Returns:
- normalized column name
-