Package org.osgi.service.event
Class EventProperties
java.lang.Object
org.osgi.service.event.EventProperties
The properties for an
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.
- Since:
- 1.3
- "Immutable"
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEventProperties(Map<String, ?> properties) Create an EventProperties from the specified properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()This method throwsUnsupportedOperationException.booleancontainsKey(Object name) Indicates if the specified property is present.booleancontainsValue(Object value) Indicates if the specified value is present.entrySet()Return the property entries.booleanCompares thisEventPropertiesobject to another object.Return the value of the specified property.inthashCode()Returns a hash code value for this object.booleanisEmpty()Indicate if this properties is empty.keySet()Return the names of the properties.This method throwsUnsupportedOperationException.voidThis method throwsUnsupportedOperationException.This method throwsUnsupportedOperationException.intsize()Return the number of properties.toString()Returns the string representation of this object.values()Return the properties values.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
EventProperties
Create an EventProperties from the specified properties.The specified properties will be copied into this EventProperties. Properties whose key is not of type
Stringwill be ignored. A property with the key "event.topics" will be ignored.- Parameters:
properties- The properties to use for this EventProperties object (may benull).
-
-
Method Details
-
clear
public void clear()This method throwsUnsupportedOperationException.- Specified by:
clearin interfaceMap<String,Object> - Throws:
UnsupportedOperationException- if called.
-
containsKey
Indicates if the specified property is present.- Specified by:
containsKeyin interfaceMap<String,Object> - Parameters:
name- The property name.- Returns:
trueIf the property is present,falseotherwise.
-
containsValue
Indicates if the specified value is present.- Specified by:
containsValuein interfaceMap<String,Object> - Parameters:
value- The property value.- Returns:
trueIf the value is present,falseotherwise.
-
entrySet
Return the property entries. -
get
Return the value of the specified property. -
isEmpty
public boolean isEmpty()Indicate if this properties is empty. -
keySet
Return the names of the properties. -
put
This method throwsUnsupportedOperationException.- Specified by:
putin interfaceMap<String,Object> - Throws:
UnsupportedOperationException- if called.
-
putAll
This method throwsUnsupportedOperationException.- Specified by:
putAllin interfaceMap<String,Object> - Throws:
UnsupportedOperationException- if called.
-
remove
This method throwsUnsupportedOperationException.- Specified by:
removein interfaceMap<String,Object> - Throws:
UnsupportedOperationException- if called.
-
size
public int size()Return the number of properties. -
values
Return the properties values. -
equals
Compares thisEventPropertiesobject to another object.The properties are compared using the
java.util.Map.equals()rules which includes identity comparison for array values. -
hashCode
public int hashCode()Returns a hash code value for this object. -
toString
Returns the string representation of this object.
-