org.eodisp.util.configuration
Interface Configuration.Entry

All Known Implementing Classes:
ConfigurationImpl.EntryImpl
Enclosing interface:
Configuration

public static interface Configuration.Entry

This interface represents one entry (option) of a configuration.


Method Summary
 boolean getBoolean()
          Returns the boolean value of this configuration entry.
 Configuration getConfiguration()
          Returns the configuration that this entry belongs to.
 java.lang.String getDescription()
          Returns the description of this configuration entry
 java.lang.String getDoc()
          Returns a string representing this configuration entry.
 java.lang.Enum getEnum()
          Returns the current string value of this configuration entry as an enumeration constant.
 java.util.EnumSet getEnumSet()
           
 java.io.File getFile()
          Always returns file instance describing an absolute path.
 java.util.List<java.io.File> getFilelist()
           
 int getInt()
          Returns the integer value of this configuration entry.
 java.lang.String getKey()
          Returns the key of this configuration entry
 long getLong()
          Returns the long value of this configuration entry.
 java.lang.String getPropertyFileComment()
           
 java.lang.Class getType()
          Returns the type of this configuration entry.
 java.lang.String getValue()
          Returns the value if it is set (non null) or the default value otherwise.
 boolean isList()
           
 boolean isSet()
          Returns true if this configuration has a value other than the default value.
 void setBoolean(boolean enabled)
          Sets the string value of this entry to the given boolean value.
 void setDescription(java.lang.String description)
          Sets the description of this configuration entry.
 void setEnum(java.lang.Enum theEnum)
          Sets the current string value to the given enumeration constant.
 void setEnumSet(java.util.EnumSet enumSet)
           
 void setFile(java.io.File file)
          Sets the current string value to the given file.
 void setInt(int port)
          Sets the value to the given integer value.
 void setLong(long value)
          Sets the value to the given long value.
 void setValue(java.lang.String string)
          Sets the value for this configuration entry.
 void setValue(java.lang.String[] stringArray)
          Sets the value if this configuration entry allows a list of entries (isList() returns true) for this configuration entry.
 

Method Detail

getKey

java.lang.String getKey()
Returns the key of this configuration entry

Returns:
the key of this configuration entry

getValue

java.lang.String getValue()
Returns the value if it is set (non null) or the default value otherwise. Never returns null.

Returns:
the value of this configuration option

setValue

void setValue(java.lang.String string)
Sets the value for this configuration entry. It shall not set the value if the given value equals to the current value.

Parameters:
value - null means to use the default value.

setValue

void setValue(java.lang.String[] stringArray)
Sets the value if this configuration entry allows a list of entries (isList() returns true) for this configuration entry. It shall not set the value if the given value equals to the current value.

Parameters:
stringArray - null means to use the default value.

getType

java.lang.Class getType()
Returns the type of this configuration entry. The following types are supported: Note that all configuration entries are stored as strings. The type returned by this method only indicates to what class this string can be transformed to.

Returns:
the type of this configuration entry

getDescription

java.lang.String getDescription()
Returns the description of this configuration entry

Returns:
the description of this configuration entry

setDescription

void setDescription(java.lang.String description)
Sets the description of this configuration entry.

Parameters:
description - the description of this configuration entry.

isSet

boolean isSet()
Returns true if this configuration has a value other than the default value.

Returns:
true if this configuration has a value other than the default value.

getInt

int getInt()
Returns the integer value of this configuration entry.

Returns:
The integer value of this configuration entry. If the value cannot be parsed as an integer value, the default value is parsed and returned. If the default value cannot be parsed as an integer value, 0 is returned.

setInt

void setInt(int port)
Sets the value to the given integer value.

Parameters:
value - The value to be set.

getLong

long getLong()
Returns the long value of this configuration entry.

Returns:
The long value of this configuration entry. If the value cannot be parsed as a long value, the default value is parsed and returned. If the default value cannot be parsed as an long value, 0 is returned.

setLong

void setLong(long value)
Sets the value to the given long value.

Parameters:
value - The value to be set.

getBoolean

boolean getBoolean()
Returns the boolean value of this configuration entry.

Returns:
The boolean value of this configuration entry. If the value cannot be parsed as a boolean value, the default value is parsed and returned. If the default value cannot be parsed as a boolean value, false is returned.
See Also:
Boolean.parseBoolean(java.lang.String)

setBoolean

void setBoolean(boolean enabled)
Sets the string value of this entry to the given boolean value.

Parameters:
enabled - the boolean value to be set.
See Also:
Boolean.toString(boolean)

getFile

java.io.File getFile()
Always returns file instance describing an absolute path.

Returns:
the entry resolved to an absolute path.

setFile

void setFile(java.io.File file)
Sets the current string value to the given file.

Parameters:
file - the file the value should be set to.

getEnum

java.lang.Enum getEnum()
Returns the current string value of this configuration entry as an enumeration constant.

Returns:

setEnum

void setEnum(java.lang.Enum theEnum)
Sets the current string value to the given enumeration constant.

Parameters:
theEnum - the enumeration constant the value should be set to.

getEnumSet

java.util.EnumSet getEnumSet()

isList

boolean isList()

setEnumSet

void setEnumSet(java.util.EnumSet enumSet)

getConfiguration

Configuration getConfiguration()
Returns the configuration that this entry belongs to.


getDoc

java.lang.String getDoc()
Returns a string representing this configuration entry.

Returns:
a string representing this configuration entry.

getPropertyFileComment

java.lang.String getPropertyFileComment()

getFilelist

java.util.List<java.io.File> getFilelist()