@Test public void testDefaultMethod_InSubclass() { PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>( TestInterfaceImplSub.class, TestInterface.RO_DEFAULT_METHOD); TestInterface testInterfaceImpl = new TestInterfaceImplSub(); String propertyValue = propertyAccessor.getPropertyValue(testInterfaceImpl); assertEquals("Hello", propertyValue); }
public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); }
PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } }
PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); }
PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } 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 V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } 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();  }