@Test public void wrapAndBeanSetCastedValue() { Outline<TestBeanClassWithVariousProperties> outline = OutlineBuilder.DEFAULT.defaultCamelCased() .build(TestBeanClassWithVariousProperties.class); TestBeanClassWithVariousProperties instance = new TestBeanClassWithVariousProperties(); outline.wrap(instance) .set(m -> m.isBooleanProperty(), new StringValue("true")) .set(m -> m.getByteProperty(), new StringValue("10")) .set(m -> m.getCharProperty(), new StringValue("c")) .set(m -> m.getDoubleProperty(), new StringValue("1.0")) .set(m -> m.getFloatProperty(), new StringValue("2.0")) .set(m -> m.getIntProperty(), new StringValue("1")) .set(m -> m.getLongProperty(), new StringValue("2")) .set(m -> m.getShortProperty(), new StringValue("3")) .set(m -> m.getStringProperty(), new StringValue("string")); assertEquals(true, instance.isBooleanProperty()); assertEquals(10, instance.getByteProperty()); assertEquals('c', instance.getCharProperty()); assertEquals(1.0d, instance.getDoubleProperty(), 0.1); assertEquals(2.0f, instance.getFloatProperty(), 0.1); assertEquals(1, instance.getIntProperty()); assertEquals(2, instance.getLongProperty()); assertEquals(3, instance.getShortProperty()); assertEquals("string", instance.getStringProperty()); }
@Override public Bean<T> wrap(T instance) { return new BeanImpl(instance); }
OutlineImpl implements Outline<T> { @Override public Bean<T> wrap(T instance) { return new BeanImpl(instance); } }
OutlineImpl implements Outline<T> { @Override public Bean<T> wrap(T instance) { return new BeanImpl(instance); } OutlineImpl(T members, boolean camelCased); }
OutlineImpl implements Outline<T> { @Override public Bean<T> wrap(T instance) { return new BeanImpl(instance); } OutlineImpl(T members, boolean camelCased); @Override String camelCasedName(); @Override String camelCasedPluralName(); @Override A getAnnotation(Class<A> annotationClass); @Override boolean hasAnnotation(Class<? extends Annotation> annotationClass); @Override Collection<foundation.stack.datamill.reflection.Method> methods(); @Override Member member(Consumer<T> memberInvoker); @Override String name(); @Override String pluralName(); @Override Property property(Consumer<T> memberInvoker); @Override Collection<String> propertyNames(); @Override Collection<Property> properties(); @Override String snakeCasedName(); @Override String snakeCasedPluralName(); @Override Bean<T> wrap(T instance); @Override Outline<T> withPluralName(String pluralName); }
OutlineImpl implements Outline<T> { @Override public Bean<T> wrap(T instance) { return new BeanImpl(instance); } OutlineImpl(T members, boolean camelCased); @Override String camelCasedName(); @Override String camelCasedPluralName(); @Override A getAnnotation(Class<A> annotationClass); @Override boolean hasAnnotation(Class<? extends Annotation> annotationClass); @Override Collection<foundation.stack.datamill.reflection.Method> methods(); @Override Member member(Consumer<T> memberInvoker); @Override String name(); @Override String pluralName(); @Override Property property(Consumer<T> memberInvoker); @Override Collection<String> propertyNames(); @Override Collection<Property> properties(); @Override String snakeCasedName(); @Override String snakeCasedPluralName(); @Override Bean<T> wrap(T instance); @Override Outline<T> withPluralName(String pluralName);  }