Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.query.remote.indexing;
 
 import  org.infinispan.commons.marshall.Marshaller;
 
 import java.util.Set;

Converts the (Protobuf encoded) binary values put in remote caches to a hibernate-search indexing-enabled wrapper object that has the proper FieldBridge to decode the data and construct the Lucene document to be indexed. Only operations that have the flag Flag.OPERATION_HOTROD are intercepted.

Author(s):
anistor@redhat.com
Since:
6.0
      return flags != null && flags.contains(.) ?  : ;
   }

   
A no-op converter.
   private static class PassThroughTypeConverter implements TypeConverter<ObjectObjectObjectObject> {
      @Override
      public Object boxKey(Object key) {
         return key;
      }
      @Override
      public Object boxValue(Object value) {
         return value;
      }
      @Override
      public Object unboxKey(Object target) {
         return target;
      }
      @Override
      public Object unboxValue(Object target) {
         return target;
      }
      @Override
      public boolean supportsInvocation(Flag flag) {
         return false;
      }
      @Override
      public void setMarshaller(Marshaller marshaller) {
      }
   }

   
A converter that wraps/unwraps the value (a byte[]) into a ProtobufValueWrapper.
   private static class ProtobufValueWrapperTypeConverter extends PassThroughTypeConverter {
      @Override
      public Object boxValue(Object value) {
         if (value instanceof byte[]) {
            return new ProtobufValueWrapper((byte[]) value);
         }
         return value;
      }
      @Override
      public Object unboxValue(Object target) {
         if (target instanceof ProtobufValueWrapper) {
            return ((ProtobufValueWrappertarget).getBinary();
         }
         return target;
      }
   }
New to GrepCode? Check out our FAQ X