Package org.infinispan.server.memcached

Examples of org.infinispan.server.memcached.MemcachedValue


   public Object encodeValue(Object value) throws CodecException {
      if (value != null) {
         if (value instanceof MemcachedValue) {
            return value;
         } else if (value instanceof byte[]) {
            return new MemcachedValue((byte[])value, 1, 0);
         } else if (value instanceof String) {
            return new MemcachedValue(((String)value).getBytes(UTF8), 1, 0);
         } else {
            throw log.valueEncodingFailed(value.getClass().getName(), this.getName());
         }
      } else {
         return null;
View Full Code Here


   }

   @Override
   public Object decodeValue(Object value) {
      if (value != null) {
         MemcachedValue mv = (MemcachedValue)value;
         return new String(mv.data(), UTF8);
      } else {
         return null;
      }

   }
View Full Code Here

   }

   @Override
   public Object decodeValue(Object value) {
      if (value != null) {
         MemcachedValue mv = (MemcachedValue)value;
         return mv.data();
      } else {
         return null;
      }

   }
View Full Code Here

   public Object encodeValue(Object value) throws CodecException {
      if (value != null) {
         if (value instanceof MemcachedValue) {
            return value;
         } else if (value instanceof byte[]) {
            return new MemcachedValue((byte[])value, 1, 0);
         } else if (value instanceof String) {
            return new MemcachedValue(((String)value).getBytes(UTF8), 1, 0);
         } else {
            throw log.valueEncodingFailed(value.getClass().getName(), this.getName());
         }
      } else {
         return null;
View Full Code Here

   }

   @Override
   public Object decodeValue(Object value) {
      if (value != null) {
         MemcachedValue mv = (MemcachedValue)value;
         return new String(mv.data(), UTF8);
      } else {
         return null;
      }

   }
View Full Code Here

TOP

Related Classes of org.infinispan.server.memcached.MemcachedValue

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.