Class MethodAccessedProperty<T>

java.lang.Object
org.axonframework.common.property.MethodAccessedProperty<T>
Type Parameters:
T - The type of object defining this property
All Implemented Interfaces:
Property<T>

public class MethodAccessedProperty<T> extends Object implements Property<T>
Property implementation that invokes a method to obtain a value of a property for a given instance.
Since:
2.0
Author:
Maxim Fedorov, Allard Buijze
  • Constructor Details

    • MethodAccessedProperty

      public MethodAccessedProperty(Method accessorMethod, String propertyName)
      Initialize a reader that uses given accessorMethod to access a property with given propertyName.
      Parameters:
      accessorMethod - The method providing the property value
      propertyName - The name of the property
  • Method Details

    • getValue

      public <V> V getValue(T target)
      Description copied from interface: Property
      Returns the value of the property on given target.
      Specified by:
      getValue in interface Property<T>
      Type Parameters:
      V - The type of value expected
      Parameters:
      target - The instance to get the property value from
      Returns:
      the property value on target