public MetaValue[] calculateIndex(CompositeValue value) { validateCompositeValue(value); return value.getAll(indexNames); }
/** * Construct Composite Value * * @param compositeMetaType the composite type of the data * @param items map of strings to values * @throws IllegalArgumentException for a null metaType */ public CompositeValueSupport(CompositeMetaType compositeMetaType, Map<String, MetaValue> items) { init(compositeMetaType, items); }
private MetaValueFactory getMetaValueFactory() { if(metaValueFactory == null) metaValueFactory = MetaValueFactory.getInstance(); return metaValueFactory; }
public MetaValue buildMetaValue(String value) throws Exception { return SimpleValueSupport.wrap(value); } }
/** * Unwrap meta value. * * @param metaValue the meta value * @return unwrapped value */ protected Object unwrap(MetaValue metaValue) { return valueFactory.unwrap(metaValue); }
/** * Create meta value. * * @param value the value * @return meta value instance */ protected MetaValue create(Object value) { return valueFactory.create(value); }
@Override public MetaValue clone() { ArrayValueSupport result = (ArrayValueSupport) super.clone(); int length = getLength(); if (value != null && length > 0) { // TODO: This is wrong as value is not an Object[] in general result.value = new Object[length]; System.arraycopy(value, 0, result.value, 0, length); } return result; }
@Override public MetaValue clone() { PropertiesMetaValue clone = new PropertiesMetaValue(); clone.putAll(this); return clone; }
/** * Create a simple value * * @param type the type * @param value the value * @return the simple value */ public static SimpleValue createSimpleValue(SimpleMetaType type, Serializable value) { if (value == null) return null; return new SimpleValueSupport(type, value); }
@Override public String toString() { return metaType + ":" + deepToString(); }
public Iterator<Object> iterator() { return new ArrayValueIterator(value); }
@Override public MetaValue createMetaValue(MetaType metaType, Properties object) { PropertiesMetaValue map = new PropertiesMetaValue(object); return map; }
public Iterator<MetaValue> iterator() { return new ElementsIterator(elements); }
public MetaValue[] calculateIndex(CompositeValue value) { validateCompositeValue(value); return value.getAll(indexNames); }
@Override public MetaValue clone() { ArrayValueSupport result = (ArrayValueSupport) super.clone(); int length = getLength(); if (value != null && length > 0) { // TODO: This is wrong as value is not an Object[] in general result.value = new Object[length]; System.arraycopy(value, 0, result.value, 0, length); } return result; }
/** * Build a PropertiesMetaValue from a Properties by copying all key/value * pairs from props into the new PropertiesMetaValue. * * @param props - the Properties to copy * @return PropertiesMetaValue */ public static PropertiesMetaValue wrap(Map<String,String> props) { PropertiesMetaValue value = new PropertiesMetaValue(); value.putAll(props); return value; }
/** * Construct Composite Value * * @param compositeMetaType the composite type of the data * @param items map of strings to values * @throws IllegalArgumentException for a null metaType */ public CompositeValueSupport(CompositeMetaType compositeMetaType, Map<String, MetaValue> items) { init(compositeMetaType, items); }
@Override public String toString() { return metaType + ":" + deepToString(); }
public Iterator<T> iterator() { return new ArrayValueIterator<T>(value); }