@Test public void shouldMapBoolean() { Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true)); Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true, null, BooleanNode.class)); Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true, null, IPrimitiveNode.class)); Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true, null, IJsonNode.class)); Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true, null, AbstractJsonNode.class)); Assert.assertEquals(BooleanNode.valueOf(true), this.mapper.map(true, null, Object.class)); Assert.assertSame(BooleanNode.class, this.mapper.getDefaultMappingType(Boolean.TYPE)); Assert.assertSame(BooleanNode.class, this.mapper.getDefaultMappingType(Boolean.class)); }
public IJsonNode map(final Object value) { if (value == null) return NullNode.getInstance(); final Type type = this.getDefaultMappingType(value.getClass()); if (type == null) throw new IllegalArgumentException("Cannot find appropriate json type for " + value); return this.map(value, null, type); }
JavaToJsonMapper extends AbstractTypeMapper<TypeMapper<?, ?>> { public IJsonNode map(final Object value) { if (value == null) return NullNode.getInstance(); final Type type = this.getDefaultMappingType(value.getClass()); if (type == null) throw new IllegalArgumentException("Cannot find appropriate json type for " + value); return this.map(value, null, type); } }
JavaToJsonMapper extends AbstractTypeMapper<TypeMapper<?, ?>> { public IJsonNode map(final Object value) { if (value == null) return NullNode.getInstance(); final Type type = this.getDefaultMappingType(value.getClass()); if (type == null) throw new IllegalArgumentException("Cannot find appropriate json type for " + value); return this.map(value, null, type); } protected  JavaToJsonMapper(); }
JavaToJsonMapper extends AbstractTypeMapper<TypeMapper<?, ?>> { public IJsonNode map(final Object value) { if (value == null) return NullNode.getInstance(); final Type type = this.getDefaultMappingType(value.getClass()); if (type == null) throw new IllegalArgumentException("Cannot find appropriate json type for " + value); return this.map(value, null, type); } protected  JavaToJsonMapper(); @SuppressWarnings("unchecked") TypeMapper<F, T> getMapper(final Class<?> fromClass, final Class<T> targetType); IJsonNode map(final Object value); @SuppressWarnings("unchecked") T map(final Object from, final T to, final Type targetType); }
JavaToJsonMapper extends AbstractTypeMapper<TypeMapper<?, ?>> { public IJsonNode map(final Object value) { if (value == null) return NullNode.getInstance(); final Type type = this.getDefaultMappingType(value.getClass()); if (type == null) throw new IllegalArgumentException("Cannot find appropriate json type for " + value); return this.map(value, null, type); } protected  JavaToJsonMapper(); @SuppressWarnings("unchecked") TypeMapper<F, T> getMapper(final Class<?> fromClass, final Class<T> targetType); IJsonNode map(final Object value); @SuppressWarnings("unchecked") T map(final Object from, final T to, final Type targetType); static final JavaToJsonMapper INSTANCE; }