Class AggregateScopeDescriptor

java.lang.Object
org.axonframework.modelling.command.AggregateScopeDescriptor
All Implemented Interfaces:
Serializable, ScopeDescriptor
Direct Known Subclasses:
AggregateScopeDescriptor

public class AggregateScopeDescriptor extends Object implements ScopeDescriptor
Describes the scope of an Aggregate by means of its type and identifier.
Since:
3.3
Author:
Steven van Beelen
See Also:
  • Constructor Details

    • AggregateScopeDescriptor

      public AggregateScopeDescriptor(String type, Supplier<Object> identifierSupplier)
      Instantiate an AggregateScopeDescriptor with a type and identifierSupplier. Using the identifierSupplier instead of an Object for the identifier allows the creating processes to provide the identifier lazily. This is necessary when Aggregate's identifier is not create yet, for example when the AggregateScopeDescriptor is created whilst the Aggregate is still under construction.
      Parameters:
      type - A String describing the type of the Aggregate
      identifierSupplier - A Supplier of Object, which can supply the identifier of the Aggregate
    • AggregateScopeDescriptor

      @ConstructorProperties({"type","identifier"}) public AggregateScopeDescriptor(String type, Object identifier)
      Instantiate an AggregateScopeDescriptor with the provided type and identifier.
      Parameters:
      type - A String describing the type of the Aggregate
      identifier - An Object denoting the identifier of the Aggregate
  • Method Details

    • getType

      public String getType()
      Returns the type of Aggregate, as String, targeted by this scope
      Returns:
      the Aggregate targeted by this scope
    • getIdentifier

      public Object getIdentifier()
      The identifier of the Aggregate targeted with this scope
      Returns:
      the identifier of the target Aggregate
    • scopeDescription

      public String scopeDescription()
      Description copied from interface: ScopeDescriptor
      Retrieve a String description of a Scope object.
      Specified by:
      scopeDescription in interface ScopeDescriptor
      Returns:
      a String description of a Scope object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object