Class SimpleHandlerAttributes

java.lang.Object
org.axonframework.messaging.core.SimpleHandlerAttributes
All Implemented Interfaces:
HandlerAttributes

public class SimpleHandlerAttributes extends Object implements HandlerAttributes
Simple implementation of the HandlerAttributes which is given the attributes in the constructor.
Since:
4.5
Author:
Steven van Beelen
  • Constructor Details

    • SimpleHandlerAttributes

      public SimpleHandlerAttributes(Map<String,Object> attributes)
      Constructs a SimpleHandlerAttributes using the given attributes. Changes made on the given attributes after construction of a SimpleHandlerAttributes are not reflected by the constructed instance.
      Parameters:
      attributes - the attributes for this HandlerAttributes implementation
  • Method Details

    • get

      public <R> R get(String attributeKey)
      Description copied from interface: HandlerAttributes
      Retrieve the attribute for the given attributeKey. Might be null if there is no attribute present for the given key.
      Specified by:
      get in interface HandlerAttributes
      Type Parameters:
      R - the type of attribute to retrieve
      Parameters:
      attributeKey - the attribute key to retrieve an attribute for
      Returns:
      the attribute for the given attributeKey
    • getAll

      public Map<String,Object> getAll()
      Description copied from interface: HandlerAttributes
      Retrieve all attributes stored in this HandlerAttributes object.
      Specified by:
      getAll in interface HandlerAttributes
      Returns:
      all attributes stored in this HandlerAttributes object
    • contains

      public boolean contains(String attributeKey)
      Description copied from interface: HandlerAttributes
      Validates whether the given attributeKey is present in this object.
      Specified by:
      contains in interface HandlerAttributes
      Parameters:
      attributeKey - the attribute key to validate if it is present in this object
      Returns:
      true if there is an attribute for the given attributeKey present, false otherwise
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HandlerAttributes
      Validate whether zero attributes are present in this object.
      Specified by:
      isEmpty in interface HandlerAttributes
      Returns:
      true if there are no attributes present, false otherwise
    • mergedWith

      public HandlerAttributes mergedWith(HandlerAttributes other)
      Description copied from interface: HandlerAttributes
      Returns a HandlerAttributes, merging the attributes in this instance with the given attributes. If this and other have identical entries, the values from other will take precedence.
      Specified by:
      mergedWith in interface HandlerAttributes
      Parameters:
      other - The HandlerAttributes to group with this instance's attributes.
      Returns:
      A HandlerAttributes combining this instance's attributes and the given other attributes.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object