Package com.authlete.common.util
Class StringBasedTypedProperties
- java.lang.Object
-
- com.authlete.common.util.TypedProperties
-
- com.authlete.common.util.StringBasedTypedProperties
-
- Direct Known Subclasses:
PropertiesWrapper
public abstract class StringBasedTypedProperties extends TypedProperties
This is an abstract class that provides getters and setters for key-value pairs. Subclasses are required to implement the following abstract methods.void
TypedProperties.clear()
boolean
contains(String key)
String
getString(String key, String defaultValue)
void
remove(String key)
void
setString(String key, String value)
Methods below which this class implements are just wrappers over
getString(String key, String defaultValue)
orsetString(String key, String value)
.boolean
getBoolean(String key, boolean defaultValue)
float
getFloat(String key, float defaultValue)
int
getInt(String key, int defaultValue)
long
getLong(String key, long defaultValue)
void
setBoolean(String key, boolean value)
void
setFloat(String key, float value)
void
setInt(String key, int value)
void
setLong(String key, long value)
- Author:
- Takahiko Kawasaki
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StringBasedTypedProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getBoolean(String key, boolean defaultValue)
Get the value of the property identified by the key as boolean.float
getFloat(String key, float defaultValue)
Get the value of the property identified by the key as float.int
getInt(String key, int defaultValue)
Get the value of the property identified by the key as int.long
getLong(String key, long defaultValue)
Get the value of the property identified by the key as long.void
setBoolean(String key, boolean value)
Set the value to the property identified by the key.void
setFloat(String key, float value)
Set the value to the property identified by the key.void
setInt(String key, int value)
Set the value to the property identified by the key.void
setLong(String key, long value)
Set the value to the property identified by the key.-
Methods inherited from class com.authlete.common.util.TypedProperties
clear, contains, contains, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getBoolean, getBoolean, getBoolean, getEnum, getEnum, getEnum, getEnum, getEnum, getEnum, getFloat, getFloat, getFloat, getInt, getInt, getInt, getLong, getLong, getLong, getString, getString, getString, getString, remove, remove, set, set, set, set, set, set, set, set, set, set, set, set, setBoolean, setEnum, setEnum, setFloat, setInt, setLong, setString, setString
-
-
-
-
Method Detail
-
getBoolean
public boolean getBoolean(String key, boolean defaultValue)
Description copied from class:TypedProperties
Get the value of the property identified by the key as boolean. Ifkey
is null or there is no property for the key,defaultValue
is returned.- Specified by:
getBoolean
in classTypedProperties
-
getFloat
public float getFloat(String key, float defaultValue)
Description copied from class:TypedProperties
Get the value of the property identified by the key as float. Ifkey
is null or there is no property for the key,defaultValue
is returned.- Specified by:
getFloat
in classTypedProperties
-
getInt
public int getInt(String key, int defaultValue)
Description copied from class:TypedProperties
Get the value of the property identified by the key as int. Ifkey
is null or there is no property for the key,defaultValue
is returned.- Specified by:
getInt
in classTypedProperties
-
getLong
public long getLong(String key, long defaultValue)
Description copied from class:TypedProperties
Get the value of the property identified by the key as long. Ifkey
is null or there is no property for the key,defaultValue
is returned.- Specified by:
getLong
in classTypedProperties
-
setBoolean
public void setBoolean(String key, boolean value)
Description copied from class:TypedProperties
Set the value to the property identified by the key. Ifkey
is null, nothing is done.- Specified by:
setBoolean
in classTypedProperties
-
setFloat
public void setFloat(String key, float value)
Description copied from class:TypedProperties
Set the value to the property identified by the key. Ifkey
is null, nothing is done.- Specified by:
setFloat
in classTypedProperties
-
setInt
public void setInt(String key, int value)
Description copied from class:TypedProperties
Set the value to the property identified by the key. Ifkey
is null, nothing is done.- Specified by:
setInt
in classTypedProperties
-
setLong
public void setLong(String key, long value)
Description copied from class:TypedProperties
Set the value to the property identified by the key. Ifkey
is null, nothing is done.- Specified by:
setLong
in classTypedProperties
-
-