Package org.infinispan.schematic.internal.document

Examples of org.infinispan.schematic.internal.document.BasicArray$BasicEntry


     * Create a new, empty editable array that can be used as a new array value in other documents.
     *
     * @return the editable array; never null
     */
    public static EditableArray newArray() {
        return new ArrayEditor(new BasicArray(), DEFAULT_FACTORY);
    }
View Full Code Here


     *
     * @param initialCapacity the initial allocated capacity for the array
     * @return the editable array; never null
     */
    public static EditableArray newArray( int initialCapacity ) {
        return new ArrayEditor(new BasicArray(initialCapacity), DEFAULT_FACTORY);
    }
View Full Code Here

     *
     * @param values the initial values for the array
     * @return the editable array; never null
     */
    public static EditableArray newArray( Collection<?> values ) {
        BasicArray array = new BasicArray(values.size());
        array.addAllValues(values);
        return new ArrayEditor(array, DEFAULT_FACTORY);
    }
View Full Code Here

     *
     * @param values the initial values for the array
     * @return the editable array; never null
     */
    public static EditableArray newArray( Object... values ) {
        BasicArray array = new BasicArray();
        for (Object value : values) {
            array.addValue(value);
        }
        return new ArrayEditor(array, DEFAULT_FACTORY);
    }
View Full Code Here

                case ARRAY:
                    return value instanceof List<?> ? (List<?>)value : null;
                case OBJECT: // this is a document
                    if (value instanceof List<?>) return (List<?>)value;
                    Document doc = (Document)value;
                    BasicArray array = new BasicArray(doc.size());
                    final Iterator<String> indexIter = IndexSequence.infiniteSequence();
                    for (Field field : doc.fields()) {
                        String name = field.getName();
                        String index = indexIter.next();
                        if (!index.equals(name)) {
                            // The doc's field names don't match integral index values ...
                            return null;
                        }
                        array.addValue(value);
                    }
                    return array;
                case STRING:
                case INTEGER:
                case NUMBER:
View Full Code Here

TOP

Related Classes of org.infinispan.schematic.internal.document.BasicArray$BasicEntry

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.