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.Object
A 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 boolean
equals(java.lang.Object o)
@NonNull java.beans.PropertyDescriptor
getDescriptor()
The wrapped property.java.util.function.Function<T,F>
getGetter()
Returns the getter as aFunction
that takes the instance as a parameter.java.util.function.BiConsumer<T,F>
getSetter()
Returns the setter as aFunction
that takes the instance and the new value as parameters.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getGetter
public java.util.function.Function<T,F> getGetter()
Returns the getter as aFunction
that 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 aFunction
that 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-