Package org.eclipse.emf.ecp.core.util
Interface ECPProperties
-
- All Known Implementing Classes:
Properties
public interface ECPProperties
ECPProperties
are used to store key - value - pairs. It publishes observable events on theECPObserverBus
. Related Observer types:ECPPropertiesObserver
. UseECPUtil.getECPObserverBus()
to retrieve the ObserverBus andECPObserverBus#register(ECPObserver)
to register an Observer.- Author:
- Eike Stepper, Eugen Neufeld
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addObserver(ECPPropertiesObserver changeObserver)
Adds anECPPropertiesObserver
which will be notified if a property changes.void
addProperty(java.lang.String key, java.lang.String value)
Adds a key-value-pair.ECPProperties
copy()
Creates a copy of the current set of properties.java.util.Set<java.lang.String>
getKeys()
All stored keys.java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>
getProperties()
All Properties.java.lang.String
getValue(java.lang.String key)
Get the value of a property identified by this key.boolean
hasProperties()
Whether any properties are stored.void
removeObserver(ECPPropertiesObserver changeObserver)
Removes anECPPropertiesObserver
from the collection of observer which will be notified if a property changes.void
removeProperty(java.lang.String key)
Removes a property.
-
-
-
Method Detail
-
addProperty
void addProperty(java.lang.String key, java.lang.String value)
Adds a key-value-pair.- Parameters:
key
- the key of the propertyvalue
- the value of the property
-
removeProperty
void removeProperty(java.lang.String key)
Removes a property.- Parameters:
key
- of the property to remove
-
getValue
java.lang.String getValue(java.lang.String key)
Get the value of a property identified by this key.- Parameters:
key
- the key of the property to find- Returns:
- the value of the property identified by the key or null
-
getKeys
java.util.Set<java.lang.String> getKeys()
All stored keys.- Returns:
- an array of all keys
-
getProperties
java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> getProperties()
All Properties.- Returns:
- an array of Key-Value-Pairs
-
hasProperties
boolean hasProperties()
Whether any properties are stored.- Returns:
- true if at least 1 property was added, false otherwise
-
copy
ECPProperties copy()
Creates a copy of the current set of properties.- Returns:
- the copy of the current properties
-
addObserver
void addObserver(ECPPropertiesObserver changeObserver)
Adds anECPPropertiesObserver
which will be notified if a property changes.- Parameters:
changeObserver
- the observer to add
-
removeObserver
void removeObserver(ECPPropertiesObserver changeObserver)
Removes anECPPropertiesObserver
from the collection of observer which will be notified if a property changes.- Parameters:
changeObserver
- the observer to remove
-
-