Search in sources :

Example 1 with FilterResult

use of org.infinispan.query.remote.client.FilterResult in project infinispan by infinispan.

the class FilterResultMarshaller method readFrom.

@Override
public FilterResult readFrom(ProtoStreamReader reader) throws IOException {
    byte[] instance = reader.readBytes("instance");
    List<WrappedMessage> projection = reader.readCollection("projection", new ArrayList<>(), WrappedMessage.class);
    List<WrappedMessage> sortProjection = reader.readCollection("sortProjection", new ArrayList<>(), WrappedMessage.class);
    Object i = null;
    if (instance != null) {
        i = ProtobufUtil.fromWrappedByteArray(reader.getSerializationContext(), instance);
    }
    Object[] p = null;
    if (!projection.isEmpty()) {
        p = new Object[projection.size()];
        int j = 0;
        for (WrappedMessage m : projection) {
            p[j++] = m.getValue();
        }
    }
    Comparable[] sp = null;
    if (!sortProjection.isEmpty()) {
        sp = new Comparable[sortProjection.size()];
        int j = 0;
        for (WrappedMessage m : sortProjection) {
            sp[j++] = (Comparable) m.getValue();
        }
    }
    return new FilterResult(i, p, sp);
}
Also used : WrappedMessage(org.infinispan.protostream.WrappedMessage) FilterResult(org.infinispan.query.remote.client.FilterResult)

Aggregations

WrappedMessage (org.infinispan.protostream.WrappedMessage)1 FilterResult (org.infinispan.query.remote.client.FilterResult)1