public class CustomPropertyProvider extends java.lang.Object implements ICustomPropertyProvider
Constructor and Description |
---|
CustomPropertyProvider() |
CustomPropertyProvider(ICustomPropertyProvider propertyProviderToBeCopied)
Copy Constructor for copying instances of CustomPropertyProviders.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolValue(java.lang.String propertyName)
Gets the boolean value of the custom property with the provided name.
|
boolean |
getBoolValue(java.lang.String propertyName,
boolean defaultValue)
Gets the boolean value of the custom property with the provided name.
|
byte |
getByteValue(java.lang.String propertyName)
Gets the byte value of the custom property with the provided name.
|
byte |
getByteValue(java.lang.String propertyName,
byte defaultValue)
Gets the byte value of the custom property with the provided name.
|
java.awt.Color |
getColorValue(java.lang.String propertyName)
Gets the color value of the custom property with the provided name.
|
java.awt.Color |
getColorValue(java.lang.String propertyName,
java.awt.Color defaultValue)
Gets the color value of the custom property with the provided name.
|
double |
getDoubleValue(java.lang.String propertyName)
Gets the double value of the custom property with the provided name.
|
double |
getDoubleValue(java.lang.String propertyName,
double defaultValue)
Gets the double value of the custom property with the provided name.
|
<T extends java.lang.Enum<T>> |
getEnumValue(java.lang.String propertyName,
java.lang.Class<T> enumType)
Gets the enum value of the custom property with the provided name.
|
<T extends java.lang.Enum<T>> |
getEnumValue(java.lang.String propertyName,
java.lang.Class<T> enumType,
T defaultValue)
Gets the enum value of the custom property with the provided name.
|
java.net.URL |
getFileValue(java.lang.String propertyName)
Gets the file value of the custom property with the provided name.
|
java.net.URL |
getFileValue(java.lang.String propertyName,
java.net.URL defaultValue)
Gets the file value of the custom property with the provided name.
|
float |
getFloatValue(java.lang.String propertyName)
Gets the float value of the custom property with the provided name.
|
float |
getFloatValue(java.lang.String propertyName,
float defaultValue)
Gets the float value of the custom property with the provided name.
|
int |
getIntValue(java.lang.String propertyName)
Gets the int value of the custom property with the provided name.
|
int |
getIntValue(java.lang.String propertyName,
int defaultValue)
Gets the int value of the custom property with the provided name.
|
long |
getLongValue(java.lang.String propertyName,
long defaultValue)
Gets the long value of the custom property with the provided name.
|
java.util.Map<java.lang.String,ICustomProperty> |
getProperties()
Returns a
Map view of the custom properties for this ICustomPropertyProvider . |
ICustomProperty |
getProperty(java.lang.String propertyName) |
short |
getShortValue(java.lang.String propertyName)
Gets the short value of the custom property with the provided name.
|
short |
getShortValue(java.lang.String propertyName,
short defaultValue)
Gets the short value of the custom property with the provided name.
|
java.lang.String |
getStringValue(java.lang.String propertyName)
Gets the string value of the custom property with the provided name.
|
java.lang.String |
getStringValue(java.lang.String propertyName,
java.lang.String defaultValue)
Gets the string value of the custom property with the provided name.
|
java.lang.String |
getTypeOfProperty(java.lang.String propertyName) |
boolean |
hasCustomProperty(java.lang.String propertyName)
Checks if a custom property with the given name is present.
|
void |
removeProperty(java.lang.String propertyName) |
void |
setProperties(java.util.Map<java.lang.String,ICustomProperty> props)
Sets all of the custom properties on this object to the provided values.
|
void |
setTypeOfProperty(java.lang.String propertyName,
java.lang.String type) |
void |
setValue(java.lang.String propertyName,
boolean value)
Sets the value for the custom property with the given name to the given boolean.
|
void |
setValue(java.lang.String propertyName,
byte value)
Sets the value for the custom property with the given name to the given byte.
|
void |
setValue(java.lang.String propertyName,
java.awt.Color value)
Sets the value for the custom property with the given name to the given color.
|
void |
setValue(java.lang.String propertyName,
double value)
Sets the value for the custom property with the given name to the given double.
|
void |
setValue(java.lang.String propertyName,
java.lang.Enum<?> value)
Sets the value for the custom property with the given name to the given enum.
|
void |
setValue(java.lang.String propertyName,
float value)
Sets the value for the custom property with the given name to the given float.
|
void |
setValue(java.lang.String propertyName,
ICustomProperty value) |
void |
setValue(java.lang.String propertyName,
int value)
Sets the value for the custom property with the given name to the given int.
|
void |
setValue(java.lang.String propertyName,
long value)
Sets the value for the custom property with the given name to the given long.
|
void |
setValue(java.lang.String propertyName,
short value)
Sets the value for the custom property with the given name to the given short.
|
void |
setValue(java.lang.String propertyName,
java.lang.String value)
Sets the value for the custom property with the given name to the given string.
|
void |
setValue(java.lang.String propertyName,
java.net.URL value)
Sets the value for the custom property with the given name to the given file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLongValue
public CustomPropertyProvider()
public CustomPropertyProvider(ICustomPropertyProvider propertyProviderToBeCopied)
propertyProviderToBeCopied
- the PropertyProvider we want to copypublic java.util.Map<java.lang.String,ICustomProperty> getProperties()
ICustomPropertyProvider
Map
view of the custom properties for this ICustomPropertyProvider
.getProperties
in interface ICustomPropertyProvider
Map
view of the custom properties for this ICustomPropertyProvider
public boolean hasCustomProperty(java.lang.String propertyName)
ICustomPropertyProvider
hasCustomProperty
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic java.lang.String getTypeOfProperty(java.lang.String propertyName)
getTypeOfProperty
in interface ICustomPropertyProvider
public void setTypeOfProperty(java.lang.String propertyName, java.lang.String type)
setTypeOfProperty
in interface ICustomPropertyProvider
public ICustomProperty getProperty(java.lang.String propertyName)
getProperty
in interface ICustomPropertyProvider
public void setValue(java.lang.String propertyName, ICustomProperty value)
setValue
in interface ICustomPropertyProvider
public java.lang.String getStringValue(java.lang.String propertyName)
ICustomPropertyProvider
getStringValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic java.lang.String getStringValue(java.lang.String propertyName, java.lang.String defaultValue)
ICustomPropertyProvider
getStringValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public int getIntValue(java.lang.String propertyName)
ICustomPropertyProvider
getIntValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic int getIntValue(java.lang.String propertyName, int defaultValue)
ICustomPropertyProvider
getIntValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public long getLongValue(java.lang.String propertyName, long defaultValue)
ICustomPropertyProvider
getLongValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public short getShortValue(java.lang.String propertyName)
ICustomPropertyProvider
getShortValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic short getShortValue(java.lang.String propertyName, short defaultValue)
ICustomPropertyProvider
getShortValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public byte getByteValue(java.lang.String propertyName)
ICustomPropertyProvider
getByteValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic byte getByteValue(java.lang.String propertyName, byte defaultValue)
ICustomPropertyProvider
getByteValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public boolean getBoolValue(java.lang.String propertyName)
ICustomPropertyProvider
getBoolValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic boolean getBoolValue(java.lang.String propertyName, boolean defaultValue)
ICustomPropertyProvider
getBoolValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public float getFloatValue(java.lang.String propertyName)
ICustomPropertyProvider
getFloatValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic float getFloatValue(java.lang.String propertyName, float defaultValue)
ICustomPropertyProvider
getFloatValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public double getDoubleValue(java.lang.String propertyName)
ICustomPropertyProvider
getDoubleValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic double getDoubleValue(java.lang.String propertyName, double defaultValue)
ICustomPropertyProvider
getDoubleValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public java.awt.Color getColorValue(java.lang.String propertyName)
ICustomPropertyProvider
getColorValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic java.awt.Color getColorValue(java.lang.String propertyName, java.awt.Color defaultValue)
ICustomPropertyProvider
getColorValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public <T extends java.lang.Enum<T>> T getEnumValue(java.lang.String propertyName, java.lang.Class<T> enumType)
ICustomPropertyProvider
getEnumValue
in interface ICustomPropertyProvider
T
- the enum type to usepropertyName
- the name of the custom propertyenumType
- a Class
object for <T>
public <T extends java.lang.Enum<T>> T getEnumValue(java.lang.String propertyName, java.lang.Class<T> enumType, T defaultValue)
ICustomPropertyProvider
getEnumValue
in interface ICustomPropertyProvider
T
- the enum type to usepropertyName
- the name of the custom propertyenumType
- a Class
object for <T>
defaultValue
- the fallback value in case the property value is null.public java.net.URL getFileValue(java.lang.String propertyName)
ICustomPropertyProvider
null
is returned instead.getFileValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertypublic java.net.URL getFileValue(java.lang.String propertyName, java.net.URL defaultValue)
ICustomPropertyProvider
getFileValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertydefaultValue
- the fallback value in case the property value is null.public void setValue(java.lang.String propertyName, java.net.URL value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, java.lang.String value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, boolean value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, byte value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, short value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, int value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, long value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, float value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, double value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, java.awt.Color value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setValue(java.lang.String propertyName, java.lang.Enum<?> value)
ICustomPropertyProvider
setValue
in interface ICustomPropertyProvider
propertyName
- the name of the custom propertyvalue
- the new valuepublic void setProperties(java.util.Map<java.lang.String,ICustomProperty> props)
ICustomPropertyProvider
setProperties
in interface ICustomPropertyProvider
props
- the new list of propertiespublic void removeProperty(java.lang.String propertyName)
removeProperty
in interface ICustomPropertyProvider