@Test void isGetter() { assertThat(Getter.isGetter( fromReference(GetterTestClass::fieldWithUnprefixedGetter), getDeclaredField(GetterTestClass.class, "fieldWithUnprefixedGetter")), is(true)); assertThat(Getter.isGetter( fromReference(GetterTestClass::getFieldWithGetPrefixedGetter), getDeclaredField(GetterTestClass.class, "fieldWithGetPrefixedGetter")), is(true)); assertThat(Getter.isGetter( fromReference(GetterTestClass::optionalFieldWithUnprefixedGetter), getDeclaredField(GetterTestClass.class, "optionalFieldWithUnprefixedGetter")), is(true)); assertThat(Getter.isGetter( fromReference(GetterTestClass::getOptionalFieldWithGetPrefixedGetter), getDeclaredField(GetterTestClass.class, "optionalFieldWithGetPrefixedGetter")), is(true)); assertThat(Getter.isGetter( fromReference(GetterTestClass::isFieldWithIsPrefixedGetter), getDeclaredField(GetterTestClass.class, "fieldWithIsPrefixedGetter")), is(true)); assertThat(Getter.isGetter( fromReference(GetterTestClass::isOptionalFieldWithIsPrefixedGetter), getDeclaredField(GetterTestClass.class, "optionalFieldWithIsPrefixedGetter")), is(true)); }
public static boolean isGetter(Method method, Field forField) { return getMethods().anyMatch(g -> StringUtils.equals(g.apply(forField.getName()), method.getName())); }
Getter extends UtilityClass { public static boolean isGetter(Method method, Field forField) { return getMethods().anyMatch(g -> StringUtils.equals(g.apply(forField.getName()), method.getName())); } }
Getter extends UtilityClass { public static boolean isGetter(Method method, Field forField) { return getMethods().anyMatch(g -> StringUtils.equals(g.apply(forField.getName()), method.getName())); }  }
Getter extends UtilityClass { public static boolean isGetter(Method method, Field forField) { return getMethods().anyMatch(g -> StringUtils.equals(g.apply(forField.getName()), method.getName())); }  @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 { public static boolean isGetter(Method method, Field forField) { return getMethods().anyMatch(g -> StringUtils.equals(g.apply(forField.getName()), method.getName())); }  @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);  }