public class EventProperties
extends java.lang.Object
implements java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,?> properties)
Create an EventProperties from the specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
This method throws
UnsupportedOperationException. |
boolean |
containsKey(java.lang.Object name)
Indicates if the specified property is present.
|
boolean |
containsValue(java.lang.Object value)
Indicates if the specified value is present.
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet()
Return the property entries.
|
boolean |
equals(java.lang.Object object)
Compares this
EventProperties object to another object. |
java.lang.Object |
get(java.lang.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.
|
java.util.Set<java.lang.String> |
keySet()
Return the names of the properties.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
This method throws
UnsupportedOperationException. |
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> map)
This method throws
UnsupportedOperationException. |
java.lang.Object |
remove(java.lang.Object key)
This method throws
UnsupportedOperationException. |
int |
size()
Return the number of properties.
|
java.lang.String |
toString()
Returns the string representation of this object.
|
java.util.Collection<java.lang.Object> |
values()
Return the properties values.
|
public EventProperties(java.util.Map<java.lang.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 java.util.Map<java.lang.String,java.lang.Object>java.lang.UnsupportedOperationException - if called.public boolean containsKey(java.lang.Object name)
containsKey in interface java.util.Map<java.lang.String,java.lang.Object>name - The property name.true If the property is present, false otherwise.public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.String,java.lang.Object>value - The property value.true If the value is present, false otherwise.public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet in interface java.util.Map<java.lang.String,java.lang.Object>public java.lang.Object get(java.lang.Object name)
get in interface java.util.Map<java.lang.String,java.lang.Object>name - The name of the specified property.public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.String,java.lang.Object>true If this properties is empty, false
otherwise.public java.util.Set<java.lang.String> keySet()
keySet in interface java.util.Map<java.lang.String,java.lang.Object>public java.lang.Object put(java.lang.String key,
java.lang.Object value)
UnsupportedOperationException.put in interface java.util.Map<java.lang.String,java.lang.Object>java.lang.UnsupportedOperationException - if called.public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> map)
UnsupportedOperationException.putAll in interface java.util.Map<java.lang.String,java.lang.Object>java.lang.UnsupportedOperationException - if called.public java.lang.Object remove(java.lang.Object key)
UnsupportedOperationException.remove in interface java.util.Map<java.lang.String,java.lang.Object>java.lang.UnsupportedOperationException - if called.public int size()
size in interface java.util.Map<java.lang.String,java.lang.Object>public java.util.Collection<java.lang.Object> values()
values in interface java.util.Map<java.lang.String,java.lang.Object>public boolean equals(java.lang.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.
equals in interface java.util.Map<java.lang.String,java.lang.Object>equals in class java.lang.Objectobject - The EventProperties object to be compared.true if object is a EventProperties and
is equal to this object; false otherwise.public int hashCode()
hashCode in interface java.util.Map<java.lang.String,java.lang.Object>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © OSGi Alliance (2000, 2018). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0