Package com.basho.riak.client.core.query

Examples of com.basho.riak.client.core.query.RiakObject


            };
       
        for (int i = 0; i < 1000; i++)
        {
            Namespace ns = new Namespace(bucketType, bucketName.toString() + i);
            RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
            Location location = new Location(ns, key);
            StoreOperation storeOp =
                new StoreOperation.Builder(location)
                    .withContent(rObj)
                    .build();
View Full Code Here


       
        PojoWithRiakFields pojo = new PojoWithRiakFields();
        JSONConverter<PojoWithRiakFields> jc =
            new JSONConverter<PojoWithRiakFields>(new TypeReference<PojoWithRiakFields>(){});
       
        RiakObject o = jc.fromDomain(pojo, null, null).getRiakObject();
       
        String json = o.getValue().toString();
        assertFalse(fieldExistsInJson(json,"key"));
        assertFalse(fieldExistsInJson(json,"bucketName"));
        assertFalse(fieldExistsInJson(json,"bucketType"));
        assertFalse(fieldExistsInJson(json,"metadata"));
        assertFalse(fieldExistsInJson(json,"index"));
View Full Code Here

    {
       
        PojoWithRiakFieldsIncluded pojo = new PojoWithRiakFieldsIncluded();
        JSONConverter<PojoWithRiakFieldsIncluded> jc =
            new JSONConverter<PojoWithRiakFieldsIncluded>(new TypeReference<PojoWithRiakFieldsIncluded>(){});
        RiakObject o = jc.fromDomain(pojo, null, null).getRiakObject();
       
        String json = o.getValue().toString();
        assertTrue(fieldExistsInJson(json,"key"));
        assertTrue(fieldExistsInJson(json,"bucketName"));
        assertTrue(fieldExistsInJson(json,"bucketType"));
        assertTrue(fieldExistsInJson(json,"metadata"));
        assertTrue(fieldExistsInJson(json,"index"));
View Full Code Here

    {
        PojoWithRiakMethodsExcluded pojo = new PojoWithRiakMethodsExcluded();
        JSONConverter<PojoWithRiakMethods> jc =
            new JSONConverter<PojoWithRiakMethods>(new TypeReference<PojoWithRiakMethods>(){});
       
        RiakObject o = jc.fromDomain(pojo, null, null).getRiakObject();
       
        String json = o.getValue().toString();
        assertFalse(fieldExistsInJson(json,"key"));
        assertFalse(fieldExistsInJson(json,"bucketName"));
        assertFalse(fieldExistsInJson(json,"bucketType"));
        assertFalse(fieldExistsInJson(json,"usermeta"));
        assertFalse(fieldExistsInJson(json,"index"));
View Full Code Here

    {
        PojoWithRiakMethodsIncluded pojo = new PojoWithRiakMethodsIncluded();
        JSONConverter<PojoWithRiakMethodsIncluded> jc =
            new JSONConverter<PojoWithRiakMethodsIncluded>(new TypeReference<PojoWithRiakMethodsIncluded>(){});
       
        RiakObject o = jc.fromDomain(pojo, null, null).getRiakObject();
       
        String json = o.getValue().toString();
        assertTrue(fieldExistsInJson(json,"key"));
        assertTrue(fieldExistsInJson(json,"bucketName"));
        assertTrue(fieldExistsInJson(json,"bucketType"));
        assertTrue(fieldExistsInJson(json,"usermeta"));
        assertTrue(fieldExistsInJson(json,"index"));
View Full Code Here

           
        JSONConverter<EmptyPojoWithRiakFields> jc =
            new JSONConverter<EmptyPojoWithRiakFields>(new TypeReference<EmptyPojoWithRiakFields>(){});
        OrmExtracted orm = jc.fromDomain(pojo, null, null);
       
        RiakObject riakObject = orm.getRiakObject();
        riakObject.setLastModified(123);
        riakObject.setVTag("vtag");
       
        Location loc = new Location(orm.getNamespace(), orm.getKey());
        EmptyPojoWithRiakFields convertedPojo = jc.toDomain(riakObject, loc);
       
        assertEquals(pojo.key, convertedPojo.key);
View Full Code Here

        pojo.foo = "foo_value";
        pojo.bar = "bar_value";
       
       
        OrmExtracted orm = converter.fromDomain(pojo , null, null);
        RiakObject ro = orm.getRiakObject();
       
        assertNotNull(ro.getValue());
       
        Namespace ns = new Namespace(Namespace.DEFAULT_BUCKET_TYPE, "bucket");
        Pojo pojo2 = converter.toDomain(ro, new Location(ns, "key"));
       
        assertEquals(pojo.foo, pojo2.foo);
View Full Code Here

        ConverterFactory factory = ConverterFactory.getInstance();
        Converter<RiakObject> converter = factory.getConverter(RiakObject.class);
       
        assertTrue(converter instanceof PassThroughConverter);
       
        RiakObject o = new RiakObject();
       
        RiakObject o2 = converter.toDomain(o, null);
        assertEquals(o, o2);
       
        OrmExtracted orm = converter.fromDomain(o, null, null);
        assertEquals(o, orm.getRiakObject());
       
View Full Code Here

       
       
        Converter.OrmExtracted orm = converter.fromDomain(foo, ns, BinaryValue.create("key"));
       
        assertNotNull(orm.getRiakObject());
        RiakObject obj = orm.getRiakObject();
        assertEquals(foo, obj.getValue().toString());
        assertEquals("text/plain", obj.getContentType());
        assertEquals(ns, orm.getNamespace());
        assertEquals("key", orm.getKey().toString());
    }
View Full Code Here

   
    @Test
    public void producesString()
    {
        String value = "some value";
        RiakObject obj = new RiakObject()
                        .setValue(BinaryValue.create(value));
        StringConverter converter = new StringConverter();
       
        String result = converter.toDomain(obj, null);
       
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.RiakObject

Copyright © 2018 www.massapicom. 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.