org.axonframework.domain
Class AbstractAggregateIdentifier

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

public abstract class AbstractAggregateIdentifier
extends Object
implements AggregateIdentifier, Comparable<AggregateIdentifier>

Abstract implementation of the aggregate identifier providing basic functionality as defined by AggregateIdentifier.

This implementation contains an implementation of the compareTo(AggregateIdentifier), equals(Object), hashCode() and toString() methods.

The compareTo(AggregateIdentifier) methods returns the result of the comparison of both identifier's string representations. For numerical values, this may not be a suitable comparison. For example, 3 would be evaluated as being larger than 10, when compared as Strings.

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

Constructor Summary
AbstractAggregateIdentifier()
           
 
Method Summary
 int compareTo(AggregateIdentifier other)
          

This implementation compared the string representations of both identifiers.

 boolean equals(Object o)
          
 int hashCode()
          

This implementation returns the hashCode of the string representation of the identifier.

 String toString()
          

This implementation returns the result of AggregateIdentifier.asString().

 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.axonframework.domain.AggregateIdentifier
asString
 

Constructor Detail

AbstractAggregateIdentifier

public AbstractAggregateIdentifier()
Method Detail

toString

public String toString()

This implementation returns the result of AggregateIdentifier.asString().

Overrides:
toString in class Object

hashCode

public int hashCode()

This implementation returns the hashCode of the string representation of the identifier.

Overrides:
hashCode in class Object

compareTo

public int compareTo(AggregateIdentifier other)

This implementation compared the string representations of both identifiers.

Specified by:
compareTo in interface Comparable<AggregateIdentifier>

equals

public boolean equals(Object o)
Description copied from interface: AggregateIdentifier

Specified by:
equals in interface AggregateIdentifier
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.