Interface ViewElement.WitherGetter<T extends ViewElement,U>

Type Parameters:
T - type of the view element
All Known Implementing Classes:
AttributeWitherFunction
Enclosing interface:
ViewElement
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ViewElement.WitherGetter<T extends ViewElement,U>
Function that fetches a value from a view element and optionally returns it as a specific type for compile time checking. Typical example: getting an attribute value.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <V extends U, W extends V>
    ViewElement.WitherGetter<T,W>
    as(Class<V> clazz)
    Cast the return value as a specific type, to avoid explicit casting in consumer code.
    getValueFrom(T target)
     
  • Method Details

    • getValueFrom

      U getValueFrom(T target)
    • as

      default <V extends U, W extends V> ViewElement.WitherGetter<T,W> as(Class<V> clazz)
      Cast the return value as a specific type, to avoid explicit casting in consumer code.