Class AnjayOutputContext

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class AnjayOutputContext
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Context which is used to send values to the LwM2M Server.
    • Constructor Summary

      Constructors 
      Constructor Description
      AnjayOutputContext​(com.avsystem.anjay.impl.NativeOutputContextPointer pointer)
      Creates output context - it is not intended to be called by user.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the context - it is not intended to be called by user.
      void retBoolean​(boolean value)
      Returns a boolean value from the data model handler.
      void retBytes​(byte[] array)
      Returns bytes from the data model handler.
      void retBytes​(byte[] array, int offset, int length)
      Returns bytes from the data model handler.
      AnjayBytesContext retBytes​(int length)
      Creates AnjayBytesContext which may be used to return bytes from the data model.
      void retBytes​(java.nio.ByteBuffer buffer)
      Returns bytes from the data model handler.
      void retDouble​(double value)
      Returns a double value from the data model handler.
      void retFloat​(float value)
      Returns a float value from the data model handler.
      void retInt​(int value)
      Returns an integer from the data model handler.
      void retLong​(long value)
      Returns a long integer from the data model handler.
      void retObjlnk​(Anjay.Objlnk value)
      Returns an Object Link value from the data model handler.
      void retString​(java.lang.String value)
      Returns a string from the data model handler.
      • Methods inherited from class java.lang.Object

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

      • AnjayOutputContext

        public AnjayOutputContext​(com.avsystem.anjay.impl.NativeOutputContextPointer pointer)
        Creates output context - it is not intended to be called by user.
    • Method Detail

      • close

        public void close()
        Closes the context - it is not intended to be called by user.
        Specified by:
        close in interface java.lang.AutoCloseable
      • retInt

        public void retInt​(int value)
                    throws AnjayException
        Returns an integer from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retLong

        public void retLong​(long value)
                     throws AnjayException
        Returns a long integer from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retFloat

        public void retFloat​(float value)
                      throws AnjayException
        Returns a float value from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retDouble

        public void retDouble​(double value)
                       throws AnjayException
        Returns a double value from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retBoolean

        public void retBoolean​(boolean value)
                        throws AnjayException
        Returns a boolean value from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retString

        public void retString​(java.lang.String value)
                       throws AnjayException
        Returns a string from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retObjlnk

        public void retObjlnk​(Anjay.Objlnk value)
                       throws AnjayException
        Returns an Object Link value from the data model handler.
        Parameters:
        value - The value to return.
        Throws:
        AnjayException - In case of failure.
      • retBytes

        public void retBytes​(java.nio.ByteBuffer buffer)
                      throws AnjayException
        Returns bytes from the data model handler.
        Parameters:
        buffer - Bytes to return.
        Throws:
        AnjayException - In case of failure.
      • retBytes

        public void retBytes​(byte[] array,
                             int offset,
                             int length)
                      throws AnjayException
        Returns bytes from the data model handler.
        Parameters:
        array - Array of bytes.
        offset - Offset in array to start reading from.
        length - Length of the data to return.
        Throws:
        AnjayException - In case of failure.
      • retBytes

        public void retBytes​(byte[] array)
                      throws AnjayException
        Returns bytes from the data model handler.
        Parameters:
        array - Array of bytes to return.
        Throws:
        AnjayException - In case of failure.