|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.naftulin.configmgr.ConfigurationManagementEntryImpl
public class ConfigurationManagementEntryImpl
Configuration management entry associates a key to a configuration, stored as a content.
In addition to key and content, it registers the file name from which a configuration was read,
whether the configuration is in an error state, and whether or not it was overwritten.
The entry is considered to be in error, if it cannot be parsed from the configuration file.
In such case, instead of the configuration, an exception would be stored in the configuration entry
content. If the configuration in error is requested, the exception is returned.
The owervritten stands flag is to show whether a configuration was programmatically
ovewrittend (by using add configuration method
. Otherwise it is false; it is also reset when reload is called
on ConfigurationManagement
. It could also be set by user.
Constructor Summary | |
---|---|
ConfigurationManagementEntryImpl(java.lang.String key,
java.lang.String fileName,
java.lang.Object content,
ConfigEntryParser processor,
ConfigurationType configurationType)
Creates a configuration management entry. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
Returns true if the object equals to this record. |
ConfigurationType |
getConfigurationType()
Returns the configuration type of this entry. |
java.lang.Object |
getContent()
Returns the content of the entry |
java.util.Date |
getCreateDate()
Returns the create date for this entry |
java.lang.String |
getFileName()
Returns file name associated with the entry |
java.lang.String |
getKey()
Returns key for the entry |
java.util.Date |
getModifiedDate()
Returns the date and time when this entry was modified. |
ConfigEntryParser |
getProcessor()
Returns the processor for this entry |
int |
hashCode()
Returns hashcode of this record. |
boolean |
isError()
Returns true if the configuration does not have a key, or file name is not associated with the entry or there is no processor associated with the entry. |
boolean |
isOverwritten()
Returns true if this entry overwrote another entry with the same key. |
void |
setModifiedDate(java.util.Date modifiedDate)
Sets the date the entry was modified. |
void |
setOverwritten(boolean overwritten)
Sets overwritten flag. |
java.lang.String |
toString()
Returns the string representation of this entry. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationManagementEntryImpl(java.lang.String key, java.lang.String fileName, java.lang.Object content, ConfigEntryParser processor, ConfigurationType configurationType)
key
- the key entry is stored underfileName
- file that is associated with the entry. Usually file that the entry is read from.content
- the content of the entry. For example properties object.processor
- the processor that can process entryMethod Detail |
---|
public java.lang.String getKey()
getKey
in interface ConfigurationManagementEntry
public java.lang.String getFileName()
getFileName
in interface ConfigurationManagementEntry
public void setOverwritten(boolean overwritten)
setOverwritten
in interface ConfigurationManagementEntry
overwritten
- public boolean isOverwritten()
isOverwritten
in interface ConfigurationManagementEntry
public boolean isError()
isError
in interface ConfigurationManagementEntry
public java.lang.Object getContent()
getContent
in interface ConfigurationManagementEntry
public java.util.Date getCreateDate()
getCreateDate
in interface ConfigurationManagementEntry
public ConfigEntryParser getProcessor()
getProcessor
in interface ConfigurationManagementEntry
public java.lang.String toString()
toString
in interface ConfigurationManagementEntry
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Date getModifiedDate()
getModifiedDate
in interface ConfigurationManagementEntry
public ConfigurationType getConfigurationType()
getConfigurationType
in interface ConfigurationManagementEntry
public void setModifiedDate(java.util.Date modifiedDate)
ConfigurationManagementEntry
setModifiedDate
in interface ConfigurationManagementEntry
modifiedDate
- modified date
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |