public interface PropertyResolver
boolean
value, or from int
to long
, etc.. Note: implementations may decide
to use case insensitive property names, therefore it is highly discouraged to use names that
differ from each other only in case sensitivity. Also, implementations may choose to trim whitespaces, thus such are
also highly discouraged.Modifier and Type | Field and Description |
---|---|
static PropertyResolver |
EMPTY
An "empty" resolver with no properties and no parent
|
Modifier and Type | Method and Description |
---|---|
default java.lang.Boolean |
getBoolean(java.lang.String name) |
default boolean |
getBooleanProperty(java.lang.String name,
boolean def) |
default java.nio.charset.Charset |
getCharset(java.lang.String name,
java.nio.charset.Charset defaultValue) |
default java.lang.Integer |
getInteger(java.lang.String name) |
default int |
getIntProperty(java.lang.String name,
int def) |
default java.lang.Long |
getLong(java.lang.String name) |
default long |
getLongProperty(java.lang.String name,
long def) |
default java.lang.Object |
getObject(java.lang.String name) |
PropertyResolver |
getParentPropertyResolver() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
A map of properties that can be used to configure the SSH server or client.
|
default java.lang.String |
getString(java.lang.String name) |
default java.lang.String |
getStringProperty(java.lang.String name,
java.lang.String def) |
default boolean |
isEmpty() |
static boolean |
isEmpty(PropertyResolver resolver) |
static final PropertyResolver EMPTY
PropertyResolver getParentPropertyResolver()
null
if no parentjava.util.Map<java.lang.String,java.lang.Object> getProperties()
A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean,
String
, etc.... If it doesn't, the toString()
result of the mapped value is used to convert it to the
required type. E.g., if the mapped value is the string "1234" and the expected value is a
long
then it will be parsed into one. Also, if the mapped value is an Integer
but a long
is expected, then it will be converted into one.
Map
containing configuration values, never null
. Note: may be
immutable.default boolean isEmpty()
default long getLongProperty(java.lang.String name, long def)
default java.lang.Long getLong(java.lang.String name)
default int getIntProperty(java.lang.String name, int def)
default java.lang.Integer getInteger(java.lang.String name)
default boolean getBooleanProperty(java.lang.String name, boolean def)
default java.lang.Boolean getBoolean(java.lang.String name)
default java.lang.String getStringProperty(java.lang.String name, java.lang.String def)
default java.lang.String getString(java.lang.String name)
default java.lang.Object getObject(java.lang.String name)
default java.nio.charset.Charset getCharset(java.lang.String name, java.nio.charset.Charset defaultValue)
static boolean isEmpty(PropertyResolver resolver)