Enum DefaultNameStrategy
- java.lang.Object
-
- java.lang.Enum<DefaultNameStrategy>
-
- com.codahale.metrics.jdbi3.strategies.DefaultNameStrategy
-
- All Implemented Interfaces:
StatementNameStrategy
,Serializable
,Comparable<DefaultNameStrategy>
public enum DefaultNameStrategy extends Enum<DefaultNameStrategy> implements StatementNameStrategy
Default strategies which build a basis of more complex strategies
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CHECK_EMPTY
If no SQL in the context, returns `sql.empty`, otherwise falls throughCONSTANT_SQL_RAW
Returns the `sql.raw` constantNAIVE_NAME
Returns a raw SQL in the context (even if it's not exist)SQL_OBJECT
If there is an SQL object attached to the context, returns the name package, the class and the method on which SQL is declared.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DefaultNameStrategy
valueOf(String name)
Returns the enum constant of this type with the specified name.static DefaultNameStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.codahale.metrics.jdbi3.strategies.StatementNameStrategy
getStatementName
-
-
-
-
Enum Constant Detail
-
CHECK_EMPTY
public static final DefaultNameStrategy CHECK_EMPTY
If no SQL in the context, returns `sql.empty`, otherwise falls through
-
SQL_OBJECT
public static final DefaultNameStrategy SQL_OBJECT
If there is an SQL object attached to the context, returns the name package, the class and the method on which SQL is declared. If not SQL object is attached, falls through
-
NAIVE_NAME
public static final DefaultNameStrategy NAIVE_NAME
Returns a raw SQL in the context (even if it's not exist)
-
CONSTANT_SQL_RAW
public static final DefaultNameStrategy CONSTANT_SQL_RAW
Returns the `sql.raw` constant
-
-
Method Detail
-
values
public static DefaultNameStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultNameStrategy c : DefaultNameStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultNameStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-