org.axonframework.common.property
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 Summary |
MethodAccessedProperty(Method accessorMethod,
String propertyName)
Initialize a reader that uses given accessorMethod to access a property with given
propertyName . |
Method Summary |
|
getValue(T target)
Returns the value of the property on given target . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 valuepropertyName
- The name of the property
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
Copyright © 2010-2016. All Rights Reserved.