@Test void forOptionalFieldWithNoGetter() { Function<GetterTestClass,Optional<Long>> fieldWithNoGetter = Getter.forField(GetterTestClass.class, Long.class, getDeclaredField(GetterTestClass.class, "optionalFieldWithNoGetter")); Optional<Long> result = fieldWithNoGetter.apply(new GetterTestClass()); assertThat(result, is(Optional.of(54323928574L))); }
@NotNull public static <T, V> Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field) { return forField(TypeToken.of(targetClass), argType, field); }
Getter extends UtilityClass { @NotNull public static <T, V> Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field) { return forField(TypeToken.of(targetClass), argType, field); } }
Getter extends UtilityClass { @NotNull public static <T, V> Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field) { return forField(TypeToken.of(targetClass), argType, field); }  }
Getter extends UtilityClass { @NotNull public static <T, V> Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field) { return forField(TypeToken.of(targetClass), argType, field); }  @NotNull static Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field); @NotNull static FunctionOptional1<T,V> forField(TypeToken<T> targetType, Class<V> argType, Field field); static boolean isGetter(Method method, Field forField); static Stream<String> possibleFieldNames(String name); }
Getter extends UtilityClass { @NotNull public static <T, V> Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field) { return forField(TypeToken.of(targetClass), argType, field); }  @NotNull static Function<T,Optional<V>> forField(Class<T> targetClass, Class<V> argType, Field field); @NotNull static FunctionOptional1<T,V> forField(TypeToken<T> targetType, Class<V> argType, Field field); static boolean isGetter(Method method, Field forField); static Stream<String> possibleFieldNames(String name);  }