Class BooleanPortability

  • All Implemented Interfaces:
    Portability<java.lang.Boolean>

    public class BooleanPortability
    extends java.lang.Object
    implements Portability<java.lang.Boolean>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.nio.ByteBuffer FALSE  
      static BooleanPortability INSTANCE  
      private static java.nio.ByteBuffer TRUE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BooleanPortability()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Boolean decode​(java.nio.ByteBuffer buffer)
      Decodes a ByteBuffer to an object of type T.
      java.nio.ByteBuffer encode​(java.lang.Boolean object)
      Encodes an object of type T as a ByteBuffer.
      boolean equals​(java.lang.Object object, java.nio.ByteBuffer buffer)
      Returns true if the encoded object once decoded would be Object.equals(Object) to the supplied object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TRUE

        private static final java.nio.ByteBuffer TRUE
      • FALSE

        private static final java.nio.ByteBuffer FALSE
    • Constructor Detail

      • BooleanPortability

        private BooleanPortability()
    • Method Detail

      • encode

        public java.nio.ByteBuffer encode​(java.lang.Boolean object)
        Description copied from interface: Portability
        Encodes an object of type T as a ByteBuffer.
        Specified by:
        encode in interface Portability<java.lang.Boolean>
        Parameters:
        object - object to be encoded
        Returns:
        the encoded object
      • decode

        public java.lang.Boolean decode​(java.nio.ByteBuffer buffer)
        Description copied from interface: Portability
        Decodes a ByteBuffer to an object of type T.
        Specified by:
        decode in interface Portability<java.lang.Boolean>
        Parameters:
        buffer - bytes to decode
        Returns:
        the decoded object
      • equals

        public boolean equals​(java.lang.Object object,
                              java.nio.ByteBuffer buffer)
        Description copied from interface: Portability
        Returns true if the encoded object once decoded would be Object.equals(Object) to the supplied object.
        Specified by:
        equals in interface Portability<java.lang.Boolean>
        Parameters:
        object - object to compare to
        buffer - buffer containing encoded object
        Returns:
        true if the two parameters are "equal"