public abstract class ParametersFromPropertyFilesStd extends java.lang.Object implements ParameterStore
ParameterStore.Entry
Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
defaultProperties |
protected java.util.Properties |
personalProperties |
Constructor and Description |
---|
ParametersFromPropertyFilesStd(java.lang.String defaultPropertyFileName) |
ParametersFromPropertyFilesStd(java.lang.String propertyFileName,
java.lang.String defaultPropertyFileName)
Constructs a new parameter container.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue(ParameterStore.Entry parmEntry)
Returns the parameter value associated with the specified entry or the default value if parameter is empty.
|
java.lang.String |
getValue(java.lang.String key)
Returns the parameter value associated with the specified key.
|
int |
getValue(java.lang.String key,
int initialValue) |
java.lang.String |
getValue(java.lang.String key,
java.lang.String initialValue) |
boolean |
getValueAsBoolean(java.lang.String key)
Returns the parameter value associated with the specified key as boolean.
|
double |
getValueAsDouble(ParameterStore.Entry parmEntry) |
double |
getValueAsDouble(java.lang.String key)
Returns the parameter value associated with the specified key as double.
|
int |
getValueAsInt(ParameterStore.Entry parmEntry) |
int |
getValueAsInt(java.lang.String key)
Returns the parameter value associated with the specified key as integer.
|
boolean |
isBlankContent()
Returns whether or not parameters are blank, which is not the case of any property file existed.
|
abstract void |
save() |
void |
saveProperties(java.lang.String headerPers,
java.lang.String headerDefault) |
void |
setValue(ParameterStore.Entry parmEntry,
int value) |
void |
setValue(ParameterStore.Entry parmEntry,
java.lang.String value)
Sets the parameter value.
|
void |
setValue(java.lang.String key,
boolean value)
Sets the parameter value.
|
void |
setValue(java.lang.String key,
double value)
Sets the parameter value.
|
void |
setValue(java.lang.String key,
int value)
Sets the parameter value.
|
void |
setValue(java.lang.String key,
java.lang.String value)
Sets the parameter value.
|
protected java.util.Properties personalProperties
protected java.util.Properties defaultProperties
public ParametersFromPropertyFilesStd(java.lang.String defaultPropertyFileName)
public ParametersFromPropertyFilesStd(java.lang.String propertyFileName, java.lang.String defaultPropertyFileName)
propertyFileName
- defaultPropertyFileName
- public boolean isBlankContent()
public java.lang.String getValue(ParameterStore.Entry parmEntry)
ParameterStore
getValue
in interface ParameterStore
parmEntry
- the entry whose parameter is to receivepublic java.lang.String getValue(java.lang.String key)
ParameterStore
getValue
in interface ParameterStore
key
- the key of the parameter to be retrievedpublic java.lang.String getValue(java.lang.String key, java.lang.String initialValue)
public void setValue(ParameterStore.Entry parmEntry, java.lang.String value)
ParameterStore
setValue
in interface ParameterStore
parmEntry
- the entry (key) of the parameter to setvalue
- the value of the parameter to setpublic void setValue(java.lang.String key, java.lang.String value)
ParameterStore
setValue
in interface ParameterStore
key
- the key of the parameter to setvalue
- the value of the parameter to setpublic int getValueAsInt(ParameterStore.Entry parmEntry)
public double getValueAsDouble(java.lang.String key)
ParameterStore
getValueAsDouble
in interface ParameterStore
key
- the key of the parameter to be retrievedpublic double getValueAsDouble(ParameterStore.Entry parmEntry)
public int getValueAsInt(java.lang.String key)
ParameterStore
getValueAsInt
in interface ParameterStore
key
- the key of the parameter to be retrievedpublic int getValue(java.lang.String key, int initialValue)
public boolean getValueAsBoolean(java.lang.String key)
ParameterStore
getValueAsBoolean
in interface ParameterStore
key
- the key of the parameter to be retrievedpublic void setValue(ParameterStore.Entry parmEntry, int value)
public void setValue(java.lang.String key, int value)
ParameterStore
setValue
in interface ParameterStore
key
- the key of the parameter to setvalue
- the value of the parameter to setpublic void setValue(java.lang.String key, double value)
ParameterStore
setValue
in interface ParameterStore
key
- the key of the parameter to setvalue
- the value of the parameter to setpublic void setValue(java.lang.String key, boolean value)
ParameterStore
setValue
in interface ParameterStore
key
- the key of the parameter to setvalue
- the value of the parameter to setpublic abstract void save()
public void saveProperties(java.lang.String headerPers, java.lang.String headerDefault)
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de