Package com.bakdata.util
Class FunctionalProperty<T,F>
- java.lang.Object
-
- com.bakdata.util.FunctionalProperty<T,F>
-
- Type Parameters:
T- the type of the class.F- the type of the field.
public final class FunctionalProperty<T,F> extends java.lang.ObjectA lambda wrapper around the a property of a class.
-
-
Constructor Summary
Constructors Constructor Description FunctionalProperty(@NonNull java.beans.PropertyDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)@NonNull java.beans.PropertyDescriptorgetDescriptor()The wrapped property.java.util.function.Function<T,F>getGetter()Returns the getter as aFunctionthat takes the instance as a parameter.java.util.function.BiConsumer<T,F>getSetter()Returns the setter as aFunctionthat takes the instance and the new value as parameters.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getGetter
public java.util.function.Function<T,F> getGetter()
Returns the getter as aFunctionthat takes the instance as a parameter.- Returns:
- the read accessor of the property.
- Sneaky Throws:
- IllegalAccessException (sneaky), Exception (sneaky)
-
getSetter
public java.util.function.BiConsumer<T,F> getSetter()
Returns the setter as aFunctionthat takes the instance and the new value as parameters.- Returns:
- the write accessor of the property.
- Sneaky Throws:
- IllegalAccessException (sneaky), Exception (sneaky)
-
getDescriptor
@NonNull public @NonNull java.beans.PropertyDescriptor getDescriptor()
The wrapped property.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-