Examples of ValueType


Examples of org.lilyproject.repository.api.ValueType

        }
        FieldType fieldType = fieldTypes.getFieldType(new SchemaIdImpl(Bytes.tail(key, key.length - 1)));
        if (context != null) {
            context.addFieldType(fieldType);
        }
        ValueType valueType = fieldType.getValueType();

        Metadata metadata = null;
        int metadataSpace = 0; // space taken up by metadata (= metadata itself + length suffix)
        int metadataEncodingVersion = FieldFlags.getFieldMetadataVersion(flags);
        if (metadataEncodingVersion == 0) {
            // there is no metadata
        } else if (metadataEncodingVersion == 1) {
            int metadataSize = Bytes.toInt(prefixedValue, prefixedValue.length - Bytes.SIZEOF_INT, Bytes.SIZEOF_INT);
            metadataSpace = metadataSize + Bytes.SIZEOF_INT;
            metadata = MetadataSerDeser.read(
                    new DataInputImpl(prefixedValue, prefixedValue.length - metadataSpace, metadataSize));
        } else {
            throw new RuntimeException("Unsupported field metadata encoding version: " + metadataEncodingVersion);
        }

        Object value = valueType.read(new DataInputImpl(prefixedValue, FieldFlags.SIZE_OF_FIELD_FLAGS,
                prefixedValue.length - FieldFlags.SIZE_OF_FIELD_FLAGS - metadataSpace));

        return new ExtractedField(fieldType, value, metadata);
    }
View Full Code Here

Examples of org.msgpack.value.ValueType

                return _currToken;
            }
        }

        MessageFormat nextFormat = messageUnpacker.getNextFormat();
        ValueType valueType = nextFormat.getValueType();

        // We should push a new StackItem lazily after updating the current stack.
        StackItem newStack = null;

        switch (valueType) {
View Full Code Here

Examples of org.openquark.util.datadictionary.ValueType

                List<List<?>> tupleList = UnsafeCast.unsafeCast(getListFromCode(code));

                List<FieldInfo> fieldInfoList = new ArrayList<FieldInfo>();
                for (final List<?> tuple : tupleList) {
                    String fieldName = (String) tuple.get(0);
                    ValueType valueType = (ValueType) tuple.get(1);

                    fieldInfoList.add(new FieldInfo(fieldName, valueType));
                }

                return fieldInfoList;
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfIntegerCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( Integer.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( integerJson() );
        List<Integer> result = (List<Integer>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( integerCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfLongCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( Long.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( longJson() );
        List<Long> result = (List<Long>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( longCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfFloatCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( Float.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( floatJson() );
        List<Float> result = (List<Float>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( floatCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfDoubleCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( Double.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( doubleJson() );
        List<Double> result = (List<Double>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( doubleCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfBigIntegerCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( BigInteger.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( bigIntegerJson() );
        List<BigInteger> result = (List<BigInteger>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( bigIntegerCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfBigDecimalCollectionWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( BigDecimal.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( bigDecimalJson() );
        List<BigDecimal> result = (List<BigDecimal>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( bigDecimalCollection(), result );
    }
View Full Code Here

Examples of org.qi4j.api.type.ValueType

    @Test
    public void givenJsonOfBigIntegerCollectionWithQuotesWhenDeserializingExpectCorrectValueOutput()
        throws Exception
    {
        ValueType collectedType = new ValueType( BigInteger.class );
        CollectionType collectionType = new CollectionType( Collection.class, collectedType );
        Object json = new JSONArray( bigIntegerJsonWithQuotes() );
        List<BigDecimal> result = (List<BigDecimal>) new JSONDeserializer( null ).deserialize( json, collectionType );
        assertEquals( bigIntegerCollection(), 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.