org.apache.directory.mavibot.btree.serializer

## Class BooleanSerializer

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer<Boolean>
  - - org.apache.directory.mavibot.btree.serializer.BooleanSerializer

- All Implemented Interfaces:
    ElementSerializer<Boolean>

      public class BooleanSerializer
      extends AbstractElementSerializer<Boolean>

  The Boolean serializer.
  Author:
    Apache Directory Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static BooleanSerializer` | `INSTANCE` A static instance of a BooleanSerializer

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | `deserialize(BufferHandler bufferHandler)` Deserialize an element from a BufferHandler
    `static Boolean` | `deserialize(byte[] in)` A static method used to deserialize a Boolean from a byte array.
    `static Boolean` | `deserialize(byte[] in, int start)` A static method used to deserialize a Boolean from a byte array.
    `Boolean` | `deserialize(ByteBuffer buffer)` Deserialize an element from a ByteBuffer
    `Boolean` | `fromBytes(byte[] in)` A method used to deserialize a Boolean from a byte array.
    `Boolean` | `fromBytes(byte[] in, int start)` A method used to deserialize a Boolean from a byte array.
    `static byte[]` | `serialize(boolean element)` Serialize a boolean
    `byte[]` | `serialize(Boolean element)` Produce the byte[] representation of the element
    `static byte[]` | `serialize(byte[] buffer, int start, boolean element)` Serialize a boolean

    - ### Methods inherited from class org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer

      `compare, getComparator, getType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final BooleanSerializer INSTANCE

      A static instance of a BooleanSerializer

  - ### Method Detail

    - #### serialize

          public byte[] serialize(Boolean element)

      Produce the byte[] representation of the element
      Parameters:
        `element` - The element to serialize
      Returns:
        The byte[] containing the serialized element

    - #### serialize

          public static byte[] serialize(boolean element)

      Serialize a boolean
      Parameters:
        `value` - the value to serialize
      Returns:
        The byte[] containing the serialized boolean

    - #### serialize

          public static byte[] serialize(byte[] buffer,
                         int start,
                         boolean element)

      Serialize a boolean
      Parameters:
        `buffer` - the Buffer that will contain the serialized value
        `start` - the position in the buffer we will store the serialized boolean
        `value` - the value to serialize
      Returns:
        The byte[] containing the serialized boolean

    - #### deserialize

          public static Boolean deserialize(byte[] in)

      A static method used to deserialize a Boolean from a byte array.
      Parameters:
        `in` - The byte array containing the boolean
      Returns:
        A boolean

    - #### deserialize

          public static Boolean deserialize(byte[] in,
                            int start)

      A static method used to deserialize a Boolean from a byte array.
      Parameters:
        `in` - The byte array containing the boolean
        `start` - the position in the byte[] we will deserialize the boolean from
      Returns:
        A boolean

    - #### fromBytes

          public Boolean fromBytes(byte[] in)

      A method used to deserialize a Boolean from a byte array.
      Parameters:
        `in` - The byte array containing the boolean
      Returns:
        A boolean

    - #### fromBytes

          public Boolean fromBytes(byte[] in,
                          int start)

      A method used to deserialize a Boolean from a byte array.
      Parameters:
        `in` - The byte array containing the boolean
        `start` - the position in the byte[] we will deserialize the boolean from
      Returns:
        A boolean

    - #### deserialize

          public Boolean deserialize(ByteBuffer buffer)
                              throws IOException

      Deserialize an element from a ByteBuffer
      Parameters:
        `buffer` - The incoming ByteBuffer
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

    - #### deserialize

          public Boolean deserialize(BufferHandler bufferHandler)
                              throws IOException

      Deserialize an element from a BufferHandler
      Parameters:
        `bufferHandler` - The incoming bufferHandler
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.