Package 

Class OptionalAttribute

  • All Implemented Interfaces:

    
    public class OptionalAttribute
    extends Attribute
                        

    This class is used for representing attributes not explicitly supported by the stack. Such attributes will generally be kept in binary form and won't be subdued to any processing by the stack. One could use this class for both dealing with attributes in received messages, and generating messages containing attributes not explicitly supported by the stack.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Array<byte> encode() Returns a binary representation of this attribute.
      char getDataLength() Returns the length of this attribute's body.
      String getName() Returns the human readable name of this attribute.
      Array<byte> getBody() Returns a reference to the unparsed body of this attribute.
      void setBody(Array<byte> body, int offset, int length) Copies the speicified byte array segment as the body of this attribute.
      boolean equals(Object obj) Compares two STUN Attributes.
      • Methods inherited from class org.ice4j.attribute.Attribute

        getAttributeType, getLocationInMessage, setLocationInMessage
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • encode

         Array<byte> encode()

        Returns a binary representation of this attribute.

      • getDataLength

         char getDataLength()

        Returns the length of this attribute's body.

      • getName

         String getName()

        Returns the human readable name of this attribute.

      • getBody

         Array<byte> getBody()

        Returns a reference to the unparsed body of this attribute.

      • setBody

         void setBody(Array<byte> body, int offset, int length)

        Copies the speicified byte array segment as the body of this attribute.

        Parameters:
        body - the body to copy
        offset - the position to start
        length - the length to copy
      • equals

         boolean equals(Object obj)

        Compares two STUN Attributes. Two attributes are considered equal when they have the same type length and value.

        Parameters:
        obj - the object to compare this attribute with.