Class 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 a Function that takes the instance as a parameter.
      java.util.function.BiConsumer<T,​F> getSetter()
      Returns the setter as a Function that takes the instance and the new value as parameters.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FunctionalProperty

        public FunctionalProperty​(@NonNull
                                  @NonNull java.beans.PropertyDescriptor descriptor)
    • Method Detail

      • getGetter

        public java.util.function.Function<T,​F> getGetter()
        Returns the getter as a Function 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 a Function 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object