Search in sources :

Example 1 with GridDirectCollection

use of org.apache.ignite.internal.GridDirectCollection in project ignite by apache.

the class MessageCodeGenerator method processField.

/**
 * @param field Field.
 * @param opt Case option.
 */
private void processField(Field field, int opt) {
    assert field != null;
    assert opt >= 0;
    GridDirectCollection colAnn = field.getAnnotation(GridDirectCollection.class);
    GridDirectMap mapAnn = field.getAnnotation(GridDirectMap.class);
    if (colAnn == null && Collection.class.isAssignableFrom(field.getType()))
        throw new IllegalStateException("@GridDirectCollection annotation is not provided for field: " + field.getName());
    if (mapAnn == null && Map.class.isAssignableFrom(field.getType()))
        throw new IllegalStateException("@GridDirectMap annotation is not provided for field: " + field.getName());
    writeField(field, opt, colAnn, mapAnn);
    readField(field, opt, colAnn, mapAnn);
}
Also used : Collection(java.util.Collection) GridDirectCollection(org.apache.ignite.internal.GridDirectCollection) GridDirectMap(org.apache.ignite.internal.GridDirectMap) GridDirectCollection(org.apache.ignite.internal.GridDirectCollection) GridDirectMap(org.apache.ignite.internal.GridDirectMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 GridDirectCollection (org.apache.ignite.internal.GridDirectCollection)1 GridDirectMap (org.apache.ignite.internal.GridDirectMap)1