org.axonframework.domain
Class UUIDAggregateIdentifier

java.lang.Object
  extended by org.axonframework.domain.AbstractAggregateIdentifier
      extended by org.axonframework.domain.StringAggregateIdentifier
          extended by org.axonframework.domain.UUIDAggregateIdentifier
All Implemented Interfaces:
Serializable, Comparable<AggregateIdentifier>, AggregateIdentifier

public class UUIDAggregateIdentifier
extends StringAggregateIdentifier

Implementation of an AggregateIdentifier that uses a UUID as backing identifier. This class is able to generate (pseudo)random identifiers (see UUID.randomUUID()) as well as reuse externally generated UUIDs as identifier values.

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

Constructor Summary
UUIDAggregateIdentifier()
          Creates a new instance using a randomly chosen UUID as identifier value.
UUIDAggregateIdentifier(String identifier)
          Creates a new instance using the UUID-formatted identifier.
UUIDAggregateIdentifier(UUID identifier)
          Creates a new instance using the given UUID as identifier value.
 
Method Summary
 
Methods inherited from class org.axonframework.domain.StringAggregateIdentifier
asString
 
Methods inherited from class org.axonframework.domain.AbstractAggregateIdentifier
compareTo, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUIDAggregateIdentifier

public UUIDAggregateIdentifier()
Creates a new instance using a randomly chosen UUID as identifier value.

See Also:
UUID.randomUUID()

UUIDAggregateIdentifier

public UUIDAggregateIdentifier(UUID identifier)
Creates a new instance using the given UUID as identifier value.

Parameters:
identifier - the UUID representation of the identifier
Throws:
NullPointerException - if the given identifier is null.

UUIDAggregateIdentifier

public UUIDAggregateIdentifier(String identifier)
Creates a new instance using the UUID-formatted identifier.

Parameters:
identifier - The UUID-formatted identifier String
See Also:
UUID.fromString(String)


Copyright © 2011. All Rights Reserved.