# Class MessageAttribute

java.lang.Object
de.javawi.jstun.attribute.MessageAttribute

All Implemented Interfaces:
  `MessageAttributeInterface`

Direct Known Subclasses:
  `ChangeRequest, Dummy, ErrorCode, MappedResponseChangedSourceAddressReflectedFrom, MessageIntegrity, Password, UnknownAttribute, Username`

public abstract class MessageAttribute extends Object implements MessageAttributeInterface

## Nested Class Summary

### Nested classes/interfaces inherited from interface MessageAttributeInterface

`MessageAttributeInterface.MessageAttributeType`

## Field Summary

### Fields inherited from interface MessageAttributeInterface

`CHANGEDADDRESS, CHANGEREQUEST, DUMMY, ERRORCODE, MAPPEDADDRESS, MESSAGEINTEGRITY, PASSWORD, REFLECTEDFROM, RESPONSEADDRESS, SOURCEADDRESS, UNKNOWNATTRIBUTE, USERNAME`

## Constructor Summary

Constructors
Constructor
Description
`MessageAttribute()`
`MessageAttribute(MessageAttributeInterface.MessageAttributeType type)`

## Method Summary

Modifier and Type
Method
Description
`abstract byte[]`
`getBytes()`
`int`
`getLength()`
`MessageAttributeInterface.MessageAttributeType`
`getType()`
`static MessageAttributeInterface.MessageAttributeType`
`intToType(long type)`
`static MessageAttribute`
`parseCommonHeader(byte[] data)`
`void`
`setType(MessageAttributeInterface.MessageAttributeType type)`
`static int`
`typeToInteger(MessageAttributeInterface.MessageAttributeType type)`

### Methods inherited from class Object

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

## Constructor Details

### MessageAttribute

public MessageAttribute()

### MessageAttribute

public MessageAttribute(MessageAttributeInterface.MessageAttributeType type)

## Method Details

### setType

public void setType(MessageAttributeInterface.MessageAttributeType type)

### getType

public MessageAttributeInterface.MessageAttributeType getType()

### typeToInteger

public static int typeToInteger(MessageAttributeInterface.MessageAttributeType type)

### intToType

public static MessageAttributeInterface.MessageAttributeType intToType(long type)

### getBytes

public abstract byte[] getBytes() throws UtilityException

Throws:
  `UtilityException`

### getLength

public int getLength() throws UtilityException

Throws:
  `UtilityException`

### parseCommonHeader

public static MessageAttribute parseCommonHeader(byte[] data) throws MessageAttributeParsingException

Throws:
  `MessageAttributeParsingException`