Package org.apache.calcite.avatica
Class ConnectionConfigImpl.PropEnv
- java.lang.Object
-
- org.apache.calcite.avatica.ConnectionConfigImpl.PropEnv
-
- Enclosing class:
- ConnectionConfigImpl
public static class ConnectionConfigImpl.PropEnv extends java.lang.ObjectThe combination of a property definition and a map of property values.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<? extends ConnectionProperty,java.lang.String>mapprivate ConnectionPropertyproperty
-
Constructor Summary
Constructors Constructor Description PropEnv(java.util.Map<? extends ConnectionProperty,java.lang.String> map, ConnectionProperty property)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T> Tget_(ConnectionConfigImpl.Converter<T> converter, java.lang.String defaultValue)booleangetBoolean()Returns the boolean value of this property.booleangetBoolean(boolean defaultValue)Returns the boolean value of this property.private <T> TgetDefaultNull(ConnectionConfigImpl.Converter<T> converter)doublegetDouble()Returns the double value of this property.doublegetDouble(java.lang.Number defaultValue)Returns the double value of this property.<E extends java.lang.Enum<E>>
EgetEnum(java.lang.Class<E> enumClass)Returns the enum value of this property.<E extends java.lang.Enum<E>>
EgetEnum(java.lang.Class<E> enumClass, E defaultValue)Returns the enum value of this property.intgetInt()Returns the int value of this property.intgetInt(java.lang.Number defaultValue)Returns the int value of this property.longgetLong()Returns the long value of this property.longgetLong(java.lang.Number defaultValue)Returns the long value of this property.<T> TgetPlugin(java.lang.Class<T> pluginClass, java.lang.String defaultClassName, T defaultInstance)Returns an instance of a plugin, using a given class name if none is set.<T> TgetPlugin(java.lang.Class<T> pluginClass, T defaultInstance)Returns an instance of a plugin.java.lang.StringgetString()Returns the string value of this property, or null if not specified and no default.java.lang.StringgetString(java.lang.String defaultValue)Returns the string value of this property, or null if not specified and no default.
-
-
-
Field Detail
-
map
final java.util.Map<? extends ConnectionProperty,java.lang.String> map
-
property
private final ConnectionProperty property
-
-
Constructor Detail
-
PropEnv
public PropEnv(java.util.Map<? extends ConnectionProperty,java.lang.String> map, ConnectionProperty property)
-
-
Method Detail
-
get_
private <T> T get_(ConnectionConfigImpl.Converter<T> converter, java.lang.String defaultValue)
-
getDefaultNull
private <T> T getDefaultNull(ConnectionConfigImpl.Converter<T> converter)
-
getString
public java.lang.String getString()
Returns the string value of this property, or null if not specified and no default.
-
getString
public java.lang.String getString(java.lang.String defaultValue)
Returns the string value of this property, or null if not specified and no default.
-
getInt
public int getInt()
Returns the int value of this property. Throws if not set and no default.
-
getInt
public int getInt(java.lang.Number defaultValue)
Returns the int value of this property. Throws if not set and no default.
-
getLong
public long getLong()
Returns the long value of this property. Throws if not set and no default.
-
getLong
public long getLong(java.lang.Number defaultValue)
Returns the long value of this property. Throws if not set and no default.
-
getDouble
public double getDouble()
Returns the double value of this property. Throws if not set and no default.
-
getDouble
public double getDouble(java.lang.Number defaultValue)
Returns the double value of this property. Throws if not set and no default.
-
getBoolean
public boolean getBoolean()
Returns the boolean value of this property. Throws if not set and no default.
-
getBoolean
public boolean getBoolean(boolean defaultValue)
Returns the boolean value of this property. Throws if not set and no default.
-
getEnum
public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> enumClass)
Returns the enum value of this property. Throws if not set and no default.
-
getEnum
public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> enumClass, E defaultValue)Returns the enum value of this property. Throws if not set and no default.
-
getPlugin
public <T> T getPlugin(java.lang.Class<T> pluginClass, T defaultInstance)Returns an instance of a plugin.Throws if not set and no default. Also throws if the class does not implement the required interface, or if it does not have a public default constructor or an public static field called
#INSTANCE.
-
getPlugin
public <T> T getPlugin(java.lang.Class<T> pluginClass, java.lang.String defaultClassName, T defaultInstance)Returns an instance of a plugin, using a given class name if none is set.Throws if not set and no default. Also throws if the class does not implement the required interface, or if it does not have a public default constructor or an public static field called
#INSTANCE.
-
-