Top Description Fields Constructors Methods
org.osgi.service.event

public Class EventProperties

extends Object
implements Map<String, Object>
Class Inheritance
All Implemented Interfaces
java.util.Map
Static Imports
org.osgi.service.event.EventConstants.EVENT_TOPIC

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.

Author
$Id: ebaab39758f3665df6cdd8bee80face91ed61ade $
Since
1.3

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>
properties

The properties for an event.

Constructor Summary

AccessConstructor and Description
public
EventProperties(Map<String, ?>
The properties to use for this EventProperties object (may be null).
properties
)

Create an EventProperties from the specified properties.

pack-priv
EventProperties(Dictionary<String, ?>
The properties to use for this EventProperties object (may be null).
properties
)

Create an EventProperties from the specified dictionary.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements java.util.Map.clear.

This method throws UnsupportedOperationException.

public boolean

Returns:

true If the property is present, false otherwise.
containsKey
(Object
The property name.
name
)

Implements java.util.Map.containsKey.

Indicates if the specified property is present.

public boolean

Returns:

true If the value is present, false otherwise.
containsValue
(Object
The property value.
value
)

Implements java.util.Map.containsValue.

Indicates if the specified value is present.

public Set<Map.Entry<String, Object>>

Returns:

A set containing the property name/value pairs.
entrySet
()

Implements java.util.Map.entrySet.

Return the property entries.

public boolean

Returns:

true if object is a EventProperties and is equal to this object; false otherwise.
equals
(Object
The EventProperties object to be compared.
object
)

Overrides java.lang.Object.equals.

Implements java.util.Map.equals.

Compares this EventProperties object to another object.

public Object

Returns:

The value of the specified property.
get
(Object
The name of the specified property.
name
)

Implements java.util.Map.get.

Return the value of the specified property.

public int

Returns:

An integer which is a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.hashCode.

Returns a hash code value for this object.

public boolean

Returns:

true If this properties is empty, false otherwise.
isEmpty
()

Implements java.util.Map.isEmpty.

Indicate if this properties is empty.

public Set<String>

Returns:

The names of the properties.
keySet
()

Implements java.util.Map.keySet.

Return the names of the properties.

public Object
put(String
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Implements java.util.Map.put.

This method throws UnsupportedOperationException.

public void
putAll(Map<? extends String, ? extends Object>
mappings to be stored in this map
map
)

Implements java.util.Map.putAll.

This method throws UnsupportedOperationException.

public Object
remove(Object
key whose mapping is to be removed from the map
key
)

Implements java.util.Map.remove.

This method throws UnsupportedOperationException.

public int

Returns:

The number of properties.
size
()

Implements java.util.Map.size.

Return the number of properties.

public String

Returns:

The string representation of this object.
toString
()

Overrides java.lang.Object.toString.

Returns the string representation of this object.

public Collection<Object>

Returns:

The values of the properties.
values
()

Implements java.util.Map.values.

Return the properties values.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

propertiesback to summary
private final Map<String, Object> properties

The properties for an event. Keys are strings and values are objects. The object is unmodifiable.

Constructor Detail

EventPropertiesback to summary
public EventProperties(Map<String, ?> properties)

Create an EventProperties from the specified 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.

Parameters
properties:Map<String, ?>

The properties to use for this EventProperties object (may be null).

EventPropertiesback to summary
pack-priv EventProperties(Dictionary<String, ?> properties)

Create an EventProperties from the specified dictionary.

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.

Parameters
properties:Dictionary<String, ?>

The properties to use for this EventProperties object (may be null).

Method Detail

clearback to summary
public void clear()

Implements java.util.Map.clear.

This method throws UnsupportedOperationException.

Annotations
@Override
Exceptions
UnsupportedOperationException:
if called.
containsKeyback to summary
public boolean containsKey(Object name)

Implements java.util.Map.containsKey.

Indicates if the specified property is present.

Parameters
name:Object

The property name.

Returns:boolean

true If the property is present, false otherwise.

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object value)

Implements java.util.Map.containsValue.

Indicates if the specified value is present.

Parameters
value:Object

The property value.

Returns:boolean

true If the value is present, false otherwise.

Annotations
@Override
entrySetback to summary
public Set<Map.Entry<String, Object>> entrySet()

Implements java.util.Map.entrySet.

Return the property entries.

Returns:Set<Map.Entry<String, Object>>

A set containing the property name/value pairs.

Annotations
@Override
equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Implements java.util.Map.equals.

Compares this EventProperties object to another object.

The properties are compared using the java.util.Map.equals() rules which includes identity comparison for array values.

Parameters
object:Object

The EventProperties object to be compared.

Returns:boolean

true if object is a EventProperties and is equal to this object; false otherwise.

Annotations
@Override
getback to summary
public Object get(Object name)

Implements java.util.Map.get.

Return the value of the specified property.

Parameters
name:Object

The name of the specified property.

Returns:Object

The value of the specified property.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.hashCode.

Returns a hash code value for this object.

Returns:int

An integer which is a hash code value for this object.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements java.util.Map.isEmpty.

Indicate if this properties is empty.

Returns:boolean

true If this properties is empty, false otherwise.

Annotations
@Override
keySetback to summary
public Set<String> keySet()

Implements java.util.Map.keySet.

Return the names of the properties.

Returns:Set<String>

The names of the properties.

Annotations
@Override
putback to summary
public Object put(String key, Object value)

Implements java.util.Map.put.

This method throws UnsupportedOperationException.

Parameters
key:String

Doc from java.util.Map.put.

key with which the specified value is to be associated

value:Object

Doc from java.util.Map.put.

value to be associated with the specified key

Returns:Object

Doc from java.util.Map.put.

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Override
Exceptions
UnsupportedOperationException:
if called.
putAllback to summary
public void putAll(Map<? extends String, ? extends Object> map)

Implements java.util.Map.putAll.

This method throws UnsupportedOperationException.

Parameters
map:Map<? extends String, ? extends Object>

Doc from java.util.Map.putAll.

mappings to be stored in this map

Annotations
@Override
Exceptions
UnsupportedOperationException:
if called.
removeback to summary
public Object remove(Object key)

Implements java.util.Map.remove.

This method throws UnsupportedOperationException.

Parameters
key:Object

Doc from java.util.Map.remove.

key whose mapping is to be removed from the map

Returns:Object

Doc from java.util.Map.remove.

the previous value associated with key, or null if there was no mapping for key.

Annotations
@Override
Exceptions
UnsupportedOperationException:
if called.
sizeback to summary
public int size()

Implements java.util.Map.size.

Return the number of properties.

Returns:int

The number of properties.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the string representation of this object.

Returns:String

The string representation of this object.

Annotations
@Override
valuesback to summary
public Collection<Object> values()

Implements java.util.Map.values.

Return the properties values.

Returns:Collection<Object>

The values of the properties.

Annotations
@Override