Class MemcachedDatabeanCodec<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,​D extends io.datarouter.model.databean.Databean<PK,​D>,​F extends io.datarouter.model.serialize.fielder.DatabeanFielder<PK,​D>>

java.lang.Object
io.datarouter.client.memcached.codec.MemcachedDatabeanCodec<PK,​D,​F>

public class MemcachedDatabeanCodec<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,​D extends io.datarouter.model.databean.Databean<PK,​D>,​F extends io.datarouter.model.serialize.fielder.DatabeanFielder<PK,​D>>
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    MemcachedDatabeanCodec​(java.lang.String nodeName, int schemaVersion, io.datarouter.model.serialize.fielder.DatabeanFielder<PK,​D> fielder, java.util.function.Supplier<D> databeanSupplier, java.util.Map<java.lang.String,​io.datarouter.model.field.Field<?>> fieldByPrefixedName)  
  • Method Summary

    Modifier and Type Method Description
    D decodeResultValue​(io.datarouter.util.tuple.Pair<java.lang.String,​java.lang.Object> result)  
    byte[] encode​(D databean)  
    java.lang.String encodeKey​(PK pk)  
    java.util.Optional<io.datarouter.util.tuple.Pair<java.lang.String,​byte[]>> encodeKeyValueIfValid​(D databean)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MemcachedDatabeanCodec

      public MemcachedDatabeanCodec​(java.lang.String nodeName, int schemaVersion, io.datarouter.model.serialize.fielder.DatabeanFielder<PK,​D> fielder, java.util.function.Supplier<D> databeanSupplier, java.util.Map<java.lang.String,​io.datarouter.model.field.Field<?>> fieldByPrefixedName)
  • Method Details

    • encodeKey

      public java.lang.String encodeKey​(PK pk)
    • encode

      public byte[] encode​(D databean)
    • encodeKeyValueIfValid

      public java.util.Optional<io.datarouter.util.tuple.Pair<java.lang.String,​byte[]>> encodeKeyValueIfValid​(D databean)
    • decodeResultValue

      public D decodeResultValue​(io.datarouter.util.tuple.Pair<java.lang.String,​java.lang.Object> result)