@Test public void testGetValueClassIllegalProperty() { PropertyAccessor<TestObject, ?> accessor = new PropertyAccessor<>(TestObject.class, "illegalProperty"); Assertions.assertThrows(IllegalArgumentException.class, () -> { accessor.getValueClass(); }); }
public Class<?> getValueClass() { return readMethod.getReturnType(); }
PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } }
PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); }
PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); boolean canInvoke(); boolean canRead(); Class<?> getValueClass(); }
PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); boolean canInvoke(); boolean canRead(); Class<?> getValueClass();  }