Examples of FieldContainer


Examples of org.mongolink.utils.FieldContainer

        assertThat(instance.getValue(), is(TestEnum.bad));
    }

    private PropertyMapper mapperForEnum() throws NoSuchMethodException {
        PropertyMapper propertyMapper = new PropertyMapper(new FieldContainer(FakeEntity.class.getDeclaredMethod("getValue")));
        propertyMapper.setMapper(parentMapper());
        return propertyMapper;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        assertThat(object.get("primitive"), is((Object) 10));
    }

    private PropertyMapper mapperForProperty() throws NoSuchMethodException {
        final PropertyMapper propertyMapper = new PropertyMapper(new FieldContainer(primitiveGetter()));
        propertyMapper.setMapper(parentMapper());
        return propertyMapper;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        assertThat(instance.getCreationDate(), is(dateTime));
    }

    private PropertyMapper propertyMapperForDateTime() throws NoSuchMethodException {
        final PropertyMapper result = new PropertyMapper(new FieldContainer(FakeEntity.class.getDeclaredMethod("getCreationDate")));
        result.setMapper(parentMapper());
        return result;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        assertThat(instance.getDateOfDay(), is(localDate));
    }

    private PropertyMapper propertyMapperForLocalDate() throws NoSuchMethodException {
        final PropertyMapper result = new PropertyMapper(new FieldContainer(FakeEntity.class.getDeclaredMethod("getDateOfDay")));
        result.setMapper(parentMapper());
        return result;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        assertThat(basicDBObject.get("k"), nullValue());
        assertThat(basicDBObject.get("ok"), is((Object) true));
    }

    private PropertyMapper propertyMapperForBoolean() throws NoSuchMethodException {
        final PropertyMapper propertyMapper = new PropertyMapper(new FieldContainer(primitiveBooleanGetter()));
        propertyMapper.setMapper(parentMapper());
        return propertyMapper;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        assertThat(dbObject.getString("value"), Matchers.is("value"));
    }

    private PropertyMapper propertyMapperFromField() throws  NoSuchFieldException {
        Field field = Fields.find(FakeAggregate.class, "value");
        final PropertyMapper result = new PropertyMapper(new FieldContainer(field));
        result.setMapper(parentMapper());
        return result;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        mapping.buildMapper(context);
        final ClassMapper classMapper = mock(ClassMapper.class);
        when(classMapper.getContext()).thenReturn(context);
        when(classMapper.getPersistentType()).thenReturn(FakeAggregate.class);
        final Method method = FakeAggregate.class.getMethod("getComment", null);
        FieldContainer fieldContainer = new FieldContainer(method);
        PropertyMapper propertyComponentMapper = new PropertyMapper(fieldContainer);
        propertyComponentMapper.setMapper(classMapper);
        return propertyComponentMapper;
    }
View Full Code Here

Examples of org.mongolink.utils.FieldContainer

        dbObject.put("list", objects);
        return dbObject;
    }

    private CollectionMapper createMapper() throws NoSuchMethodException {
        final CollectionMapper result = new CollectionMapper(new FieldContainer(EntityWithCollection.class.getMethod("getList", null)));
        final MapperContext context = new MapperContext();
        final ClassMapper classMapper = mock(ClassMapper.class);
        when(classMapper.getContext()).thenReturn(context);
        result.setMapper(classMapper);
        return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.