public class Properties extends Registry<Map.Entry<String,String>,ECPPropertiesObserver> implements ECPProperties
Modifier and Type | Class and Description |
---|---|
static class |
Properties.Property |
Constructor and Description |
---|
Properties()
Default constructor.
|
Properties(ObjectInput in) |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(String key,
String value)
Adds a key-value-pair.
|
ECPProperties |
copy()
Creates a copy of the current set of properties.
|
protected String |
getElementName(Map.Entry<String,String> element) |
protected Collection<Map.Entry<String,String>> |
getElementsToWrite() |
Set<String> |
getKeys()
All stored keys.
|
Collection<Map.Entry<String,String>> |
getProperties()
All Properties.
|
String |
getValue(String name)
Get the value of a property identified by this key.
|
boolean |
hasProperties()
Whether any properties are stored.
|
protected void |
notifyObservers(Collection<Map.Entry<String,String>> oldProperties,
Collection<Map.Entry<String,String>> newProperties)
Notifies observers that the elements in the registry have changed.
|
void |
removeProperty(String key)
Removes a property.
|
void |
write(ObjectOutput out) |
addObserver, changeElements, disposed, doChangeElements, elementsChanged, getElement, getElementCount, getElementNames, getElements, hasElement, hasElements, isDisposingElement, isRemoveDisposedElements, removeObserver
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addObserver, removeObserver
public Properties()
public Properties(ObjectInput in) throws IOException
IOException
public void write(ObjectOutput out) throws IOException
IOException
public void addProperty(String key, String value)
addProperty
in interface ECPProperties
key
- the key of the propertyvalue
- the value of the propertypublic void removeProperty(String key)
removeProperty
in interface ECPProperties
key
- of the property to removepublic String getValue(String name)
getValue
in interface ECPProperties
name
- the key of the property to findpublic Set<String> getKeys()
getKeys
in interface ECPProperties
public Collection<Map.Entry<String,String>> getProperties()
getProperties
in interface ECPProperties
public boolean hasProperties()
hasProperties
in interface ECPProperties
public ECPProperties copy()
copy
in interface ECPProperties
protected String getElementName(Map.Entry<String,String> element)
getElementName
in class Registry<Map.Entry<String,String>,ECPPropertiesObserver>
element
- the element to retrieve a name for.protected Collection<Map.Entry<String,String>> getElementsToWrite()
protected void notifyObservers(Collection<Map.Entry<String,String>> oldProperties, Collection<Map.Entry<String,String>> newProperties) throws Exception
Registry
notifyObservers
in class Registry<Map.Entry<String,String>,ECPPropertiesObserver>
oldProperties
- The old collection of elementsnewProperties
- The new collection of elementsException
Copyright © 2018. All rights reserved.