Class VersionedAggregateIdentifier

java.lang.Object
org.axonframework.modelling.command.VersionedAggregateIdentifier

public class VersionedAggregateIdentifier extends Object
Structure that holds an Aggregate Identifier and an expected version of an aggregate.
Since:
1.2
Author:
Allard Buijze
  • Constructor Details

    • VersionedAggregateIdentifier

      @Deprecated public VersionedAggregateIdentifier(String identifier, Long version)
      Deprecated.
      In favor of VersionedAggregateIdentifier(Object, Long), since the identifier can be a non-String.
      Initializes a VersionedAggregateIdentifier with the given identifier and version.
      Parameters:
      identifier - The non-null string identifier of the targeted aggregate.
      version - The expected version of the targeted aggregate, or null if the version is irrelevant.
    • VersionedAggregateIdentifier

      public VersionedAggregateIdentifier(@Nonnull Object identifier, Long version)
      Initializes a VersionedAggregateIdentifier with the given identifier and version.
      Parameters:
      identifier - The non-null identifier of the targeted aggregate.
      version - The expected version of the targeted aggregate, or null if the version is irrelevant.
  • Method Details

    • getIdentifier

      @Nonnull public String getIdentifier()
      Returns the string representation of the identifier of the targeted Aggregate. May never return null.
      Returns:
      the string representation of identifier of the targeted Aggregate
    • getIdentifierValue

      @Nonnull public Object getIdentifierValue()
      Returns the object representation of the identifier of the targeted Aggregate. May never return null.
      Returns:
      the object representation of the identifier of the targeted Aggregate
    • getVersion

      public Long getVersion()
      Returns the version of the targeted Aggregate, or null if the version is irrelevant.
      Returns:
      the version of the targeted Aggregate
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object