org.axonframework.domain
Class MutableEventMetaData

java.lang.Object
  extended by org.axonframework.domain.MutableEventMetaData
All Implemented Interfaces:
Serializable, EventMetaData

public class MutableEventMetaData
extends Object
implements Serializable, EventMetaData

Implementation of EventMetaData that allows values to be set, as well as read.

Since:
0.7
Author:
Allard Buijze
See Also:
Serialized Form

Constructor Summary
MutableEventMetaData(org.joda.time.LocalDateTime timestamp, UUID eventIdentifier)
          Create a meta-data instance with the given timestamp and eventIdentifier as initial values.
 
Method Summary
 boolean containsKey(String key)
          Indicates whether the given key has been associated with a value (which includes null).
 Serializable get(String key)
          Returns the value associated with the given key.
 UUID getEventIdentifier()
          Returns the identifier of this event.
 org.joda.time.LocalDateTime getTimestamp()
          Returns the time this event was created.
 Set<String> keySet()
          Returns a Set containing the keys registered in the event's meta data.
 void put(String key, Serializable value)
          Put a key-value pair in the meta data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableEventMetaData

public MutableEventMetaData(org.joda.time.LocalDateTime timestamp,
                            UUID eventIdentifier)
Create a meta-data instance with the given timestamp and eventIdentifier as initial values.

Parameters:
timestamp - The timestamp of the creation of the event
eventIdentifier - The identifier of the event
Method Detail

put

public void put(String key,
                Serializable value)
Put a key-value pair in the meta data.

Parameters:
key - The key for which to insert a value
value - The value to insert

getTimestamp

public org.joda.time.LocalDateTime getTimestamp()
Description copied from interface: EventMetaData
Returns the time this event was created.

Specified by:
getTimestamp in interface EventMetaData
Returns:
the time this event was created

getEventIdentifier

public UUID getEventIdentifier()
Description copied from interface: EventMetaData
Returns the identifier of this event.

Specified by:
getEventIdentifier in interface EventMetaData
Returns:
the identifier of this event

get

public Serializable get(String key)
Description copied from interface: EventMetaData
Returns the value associated with the given key. Returns null if no such key exists, or if the associated value is null. Use EventMetaData.containsKey(String) to make this distinction.

Specified by:
get in interface EventMetaData
Parameters:
key - The key to find the associated value for
Returns:
The value assiciated with the given key, or null if it does not exist

containsKey

public boolean containsKey(String key)
Description copied from interface: EventMetaData
Indicates whether the given key has been associated with a value (which includes null).

Specified by:
containsKey in interface EventMetaData
Parameters:
key - The key to check
Returns:
true if the key is associated with a value, false otherwise.

keySet

public Set<String> keySet()
Description copied from interface: EventMetaData
Returns a Set containing the keys registered in the event's meta data.

Specified by:
keySet in interface EventMetaData
Returns:
a Set containing the keys registered in the event's meta data


Copyright © 2011. All Rights Reserved.