Class LambdaBeanPropertyMemberAccessor
- java.lang.Object
-
- ai.timefold.solver.core.impl.domain.common.accessor.LambdaBeanPropertyMemberAccessor
-
- All Implemented Interfaces:
MemberAccessor
public final class LambdaBeanPropertyMemberAccessor extends Object implements MemberAccessor
AMemberAccessorbased on a getter and optionally a setter.
-
-
Constructor Summary
Constructors Constructor Description LambdaBeanPropertyMemberAccessor(Method getterMethod)LambdaBeanPropertyMemberAccessor(Method getterMethod, boolean getterOnly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectexecuteGetter(Object bean)voidexecuteSetter(Object bean, Object value)<T extends Annotation>
TgetAnnotation(Class<T> annotationClass)As defined inAnnotatedElement.getAnnotation(Class).<T extends Annotation>
T[]getDeclaredAnnotationsByType(Class<T> annotationClass)Class<?>getDeclaringClass()TypegetGenericType()As defined byMethod.getGenericReturnType()andField.getGenericType().<Fact_,Result_>
Function<Fact_,Result_>getGetterFunction()In order to support node sharing in constraint streams, we need to referenceMemberAccessor.executeGetter(Object)in a way so that the method reference stays the same instance.StringgetName()StringgetSpeedNote()Class<?>getType()booleansupportSetter()StringtoString()
-
-
-
Method Detail
-
getDeclaringClass
public Class<?> getDeclaringClass()
- Specified by:
getDeclaringClassin interfaceMemberAccessor
-
getName
public String getName()
- Specified by:
getNamein interfaceMemberAccessor
-
getType
public Class<?> getType()
- Specified by:
getTypein interfaceMemberAccessor
-
getGenericType
public Type getGenericType()
Description copied from interface:MemberAccessorAs defined byMethod.getGenericReturnType()andField.getGenericType().- Specified by:
getGenericTypein interfaceMemberAccessor- Returns:
- never null
-
executeGetter
public Object executeGetter(Object bean)
- Specified by:
executeGetterin interfaceMemberAccessor
-
getGetterFunction
public <Fact_,Result_> Function<Fact_,Result_> getGetterFunction()
Description copied from interface:MemberAccessorIn order to support node sharing in constraint streams, we need to referenceMemberAccessor.executeGetter(Object)in a way so that the method reference stays the same instance. This method returns just such a method reference.- Specified by:
getGetterFunctionin interfaceMemberAccessor- Returns:
- never null, a constant reference to
MemberAccessor.executeGetter(Object)
-
supportSetter
public boolean supportSetter()
- Specified by:
supportSetterin interfaceMemberAccessor
-
executeSetter
public void executeSetter(Object bean, Object value)
- Specified by:
executeSetterin interfaceMemberAccessor
-
getSpeedNote
public String getSpeedNote()
- Specified by:
getSpeedNotein interfaceMemberAccessor
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
Description copied from interface:MemberAccessorAs defined inAnnotatedElement.getAnnotation(Class).- Specified by:
getAnnotationin interfaceMemberAccessor
-
getDeclaredAnnotationsByType
public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass)
- Specified by:
getDeclaredAnnotationsByTypein interfaceMemberAccessor
-
-