Package org.jdbi.v3.core.mapper.reflect
Class CaseInsensitiveColumnNameMatcher
- java.lang.Object
-
- org.jdbi.v3.core.mapper.reflect.CaseInsensitiveColumnNameMatcher
-
- All Implemented Interfaces:
ColumnNameMatcher
public final class CaseInsensitiveColumnNameMatcher extends java.lang.Object implements ColumnNameMatcher
Matches column names with identical java names, ignoring case.Example: column names
firstnameorFIRSTNAMEwould match java namefirstName.
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveColumnNameMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancolumnNameMatches(java.lang.String columnName, java.lang.String propertyName)Returns whether the column name fits the given Java identifier name.booleancolumnNameStartsWith(java.lang.String columnName, java.lang.String prefix)Return whether the column name starts with the given prefix, according to the matching strategy of thisColumnNameMatcher.private booleandoMatch(java.lang.String columnName, java.lang.String propertyName, boolean columnNameMayTrailCharacters)java.lang.StringtoString()
-
-
-
Method Detail
-
columnNameMatches
public boolean columnNameMatches(java.lang.String columnName, java.lang.String propertyName)Description copied from interface:ColumnNameMatcherReturns whether the column name fits the given Java identifier name.- Specified by:
columnNameMatchesin interfaceColumnNameMatcher- Parameters:
columnName- the SQL column namepropertyName- the Java property, field, or parameter name- Returns:
- whether the given names are logically equivalent
-
columnNameStartsWith
public boolean columnNameStartsWith(java.lang.String columnName, java.lang.String prefix)Description copied from interface:ColumnNameMatcherReturn whether the column name starts with the given prefix, according to the matching strategy of thisColumnNameMatcher. This method is used by reflective mappers to short-circuit nested mapping when no column names begin with the nested prefix. By default, this method returnscolumnName.startWith(prefix). Third party implementations should override this method to match prefixes by the same criteria asColumnNameMatcher.columnNameMatches(String, String).- Specified by:
columnNameStartsWithin interfaceColumnNameMatcher- Parameters:
columnName- the column name to testprefix- the prefix to test for- Returns:
- whether the column name begins with the prefix.
-
doMatch
private boolean doMatch(java.lang.String columnName, java.lang.String propertyName, boolean columnNameMayTrailCharacters)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-