org.mentalog.encoder
Class NullEncoder

java.lang.Object
  extended by org.mentalog.encoder.NullEncoder
All Implemented Interfaces:
Encoder

public class NullEncoder
extends Object
implements Encoder


Field Summary
static byte[] NULL
           
 
Fields inherited from interface org.mentalog.encoder.Encoder
ASCII, BYTE_OR_CHAR_ARRAY, CHAR_SEQUENCE, THROWABLE
 
Constructor Summary
NullEncoder()
           
 
Method Summary
 boolean encode(Object obj, ByteBuffer bb, int varargsPos, int varargsLen)
          Encode the given object into the provided byte buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static byte[] NULL
Constructor Detail

NullEncoder

public NullEncoder()
Method Detail

encode

public boolean encode(Object obj,
                      ByteBuffer bb,
                      int varargsPos,
                      int varargsLen)
Description copied from interface: Encoder
Encode the given object into the provided byte buffer. Note: You should use instanceof to check and cast the object to a type that this encoder can encode. Each encoder receives all objects passed to the log() method. If a encoder receives an object it does not support, it does nothing and returns false, so the next encoder in the chain will be applied.

Specified by:
encode in interface Encoder
Parameters:
obj - That object to be encoded.
bb - The byte buffer that will receive the encoded object.
Returns:
true if the object was encoded, false otherwise


Copyright © 2013. All Rights Reserved.