# Class MessageHeader

java.lang.Object
de.javawi.jstun.header.MessageHeader

All Implemented Interfaces:
  `MessageHeaderInterface`

public class MessageHeader extends Object implements MessageHeaderInterface

## Nested Class Summary

### Nested classes/interfaces inherited from interface MessageHeaderInterface

`MessageHeaderInterface.MessageHeaderType`

## Field Summary

### Fields inherited from interface MessageHeaderInterface

`BINDINGERRORRESPONSE, BINDINGREQUEST, BINDINGRESPONSE, SHAREDSECRETERRORRESPONSE, SHAREDSECRETREQUEST, SHAREDSECRETRESPONSE`

## Constructor Summary

Constructors
Constructor
Description
`MessageHeader()`
`MessageHeader(MessageHeaderInterface.MessageHeaderType type)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addMessageAttribute(MessageAttribute attri)`
`boolean`
`equalTransactionID(MessageHeader header)`
`void`
`generateTransactionID()`
`byte[]`
`getBytes()`
`int`
`getLength()`
`MessageAttribute`
`getMessageAttribute(MessageAttributeInterface.MessageAttributeType type)`
`byte[]`
`getTransactionID()`
`MessageHeaderInterface.MessageHeaderType`
`getType()`
`void`
`parseAttributes(byte[] data)`
`static MessageHeader`
`parseHeader(byte[] data)`
`void`
`setTransactionID(byte[] id)`
`void`
`setType(MessageHeaderInterface.MessageHeaderType type)`
`static int`
`typeToInteger(MessageHeaderInterface.MessageHeaderType type)`

### Methods inherited from class Object

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

## Constructor Details

### MessageHeader

public MessageHeader()

### MessageHeader

public MessageHeader(MessageHeaderInterface.MessageHeaderType type)

## Method Details

### setType

public void setType(MessageHeaderInterface.MessageHeaderType type)

### getType

public MessageHeaderInterface.MessageHeaderType getType()

### typeToInteger

public static int typeToInteger(MessageHeaderInterface.MessageHeaderType type)

### setTransactionID

public void setTransactionID(byte[] id)

### generateTransactionID

public void generateTransactionID() throws UtilityException

Throws:
  `UtilityException`

### getTransactionID

public byte[] getTransactionID()

### equalTransactionID

public boolean equalTransactionID(MessageHeader header)

### addMessageAttribute

public void addMessageAttribute(MessageAttribute attri)

### getMessageAttribute

public MessageAttribute getMessageAttribute(MessageAttributeInterface.MessageAttributeType type)

### getBytes

public byte[] getBytes() throws UtilityException

Throws:
  `UtilityException`

### getLength

public int getLength() throws UtilityException

Throws:
  `UtilityException`

### parseAttributes

public void parseAttributes(byte[] data) throws MessageAttributeParsingException

Throws:
  `MessageAttributeParsingException`

### parseHeader

public static MessageHeader parseHeader(byte[] data) throws MessageHeaderParsingException

Throws:
  `MessageHeaderParsingException`