Package org.cassandraunit.type

Examples of org.cassandraunit.type.GenericType


                && StringUtils.endsWith(valueToExtract, endTypeFunction);
    }

    public static GenericType constructGenericType(String rowKeyOrColumnName, ComparatorType type,
                                                   GenericTypeEnum[] typesBelongingCompositeType) {
        GenericType key = null;

        if (type == null) {
            key = new GenericType(rowKeyOrColumnName, GenericTypeEnum.BYTES_TYPE);
        } else if (ComparatorType.COMPOSITETYPE.getTypeName().equals(type.getTypeName())) {
            /* composite type */
            try {
                key = new GenericType(StringUtils.split(rowKeyOrColumnName, ":"), typesBelongingCompositeType);
            } catch (IllegalArgumentException e) {
                throw new ParseException(rowKeyOrColumnName
                        + " doesn't fit with the schema declaration of your composite type");
            }
        } else {
            /* simple type */
            key = new GenericType(rowKeyOrColumnName, GenericTypeEnum.fromValue(type.getTypeName()));
        }
        return key;
    }
View Full Code Here


        }

        Composite composite = new Composite();
        for (int i = 0; i < genericType.getCompositeValues().length; i++) {
            composite.addComponent(
                    new GenericType(genericType.getCompositeValues()[i],
                            genericType.getTypesBelongingCompositeType()[i]), GenericTypeSerializer.get());
        }
        return composite;

    }
View Full Code Here

TOP

Related Classes of org.cassandraunit.type.GenericType

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.