public class EventProperties extends Object implements Map<String,Object>
Event. An event source can create an
EventProperties object if it needs to reuse the same event properties for
multiple events.
The keys are all of type String. The values are of type
Object. The key "event.topics" is ignored as event topics
can only be set when an Event is constructed.
Once constructed, an EventProperties object is unmodifiable. However, the values of the map used to construct an EventProperties object are still subject to modification as they are not deeply copied.
| Constructor and Description |
|---|
EventProperties(Map<String,?> properties)
Create an EventProperties from the specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
This method throws
UnsupportedOperationException. |
boolean |
containsKey(Object name)
Indicates if the specified property is present.
|
boolean |
containsValue(Object value)
Indicates if the specified value is present.
|
Set<Map.Entry<String,Object>> |
entrySet()
Return the property entries.
|
boolean |
equals(Object object)
Compares this
EventProperties object to another object. |
Object |
get(Object name)
Return the value of the specified property.
|
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isEmpty()
Indicate if this properties is empty.
|
Set<String> |
keySet()
Return the names of the properties.
|
Object |
put(String key,
Object value)
This method throws
UnsupportedOperationException. |
void |
putAll(Map<? extends String,? extends Object> map)
This method throws
UnsupportedOperationException. |
Object |
remove(Object key)
This method throws
UnsupportedOperationException. |
int |
size()
Return the number of properties.
|
String |
toString()
Returns the string representation of this object.
|
Collection<Object> |
values()
Return the properties values.
|
public EventProperties(Map<String,?> properties)
The specified properties will be copied into this EventProperties.
Properties whose key is not of type String will be ignored. A
property with the key "event.topics" will be ignored.
properties - The properties to use for this EventProperties object
(may be null).public void clear()
UnsupportedOperationException.clear in interface Map<String,Object>UnsupportedOperationException - if called.public boolean containsKey(Object name)
containsKey in interface Map<String,Object>name - The property name.true If the property is present, false otherwise.public boolean containsValue(Object value)
containsValue in interface Map<String,Object>value - The property value.true If the value is present, false otherwise.public boolean isEmpty()
public Object put(String key, Object value)
UnsupportedOperationException.put in interface Map<String,Object>UnsupportedOperationException - if called.public void putAll(Map<? extends String,? extends Object> map)
UnsupportedOperationException.putAll in interface Map<String,Object>UnsupportedOperationException - if called.public Object remove(Object key)
UnsupportedOperationException.remove in interface Map<String,Object>UnsupportedOperationException - if called.public int size()
public Collection<Object> values()
public boolean equals(Object object)
EventProperties object to another object.
The properties are compared using the java.util.Map.equals()
rules which includes identity comparison for array values.
public int hashCode()
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0