net.kano.joscar.snac
Class MutableSnacPacket

java.lang.Object
  extended byMutableSnacPacket

public final class MutableSnacPacket
extends java.lang.Object

Provides an interface for modifying the contents of a SNAC packet.


Constructor Summary
MutableSnacPacket(SnacPacket packet)
          Creates a mutable SNAC packet object with the same properties as the given object.
 
Method Summary
 int getCommand()
          Returns this packet's SNAC command code ("subtype").
 ByteBlock getData()
          Returns this packet's SNAC data block.
 int getFamily()
          Returns this packet's SNAC family code.
 short getFlag1()
          Returns this packet's first SNAC flag byte.
 short getFlag2()
          Returns this packet's second SNAC flag byte.
 long getReqid()
          Returns this packet's SNAC request ID.
 boolean isChanged()
          Returns true if this object has been modified since its creation (via one of the set methods).
 void setCommand(int command)
          Sets this packet's SNAC command subtype.
 void setData(ByteBlock data)
          Sets this packet's SNAC data block.
 void setFamily(int family)
          Sets this packet's SNAC family code.
 void setFlag1(short flag1)
          Sets this packet's first SNAC flag byte.
 void setFlag2(short flag2)
          Sets this packet's second SNAC flag byte.
 void setReqid(long reqid)
          Sets this packet's SNAC request ID.
 SnacPacket toSnacPacket()
          Returns a SNAC packet object with the same properties as this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableSnacPacket

public MutableSnacPacket(SnacPacket packet)
Creates a mutable SNAC packet object with the same properties as the given object.

Parameters:
packet - the SNAC packet whose properties are to be copied into this object
Method Detail

getFamily

public final int getFamily()
Returns this packet's SNAC family code.

Returns:
this packet's SNAC family

getCommand

public final int getCommand()
Returns this packet's SNAC command code ("subtype").

Returns:
this packet's SNAC command subtype

getReqid

public final long getReqid()
Returns this packet's SNAC request ID.

Returns:
this packet's SNAC request ID

getFlag1

public final short getFlag1()
Returns this packet's first SNAC flag byte.

Returns:
this packet's first SNAC flag byte

getFlag2

public final short getFlag2()
Returns this packet's second SNAC flag byte.

Returns:
this packet's second SNAC flag byte

getData

public final ByteBlock getData()
Returns this packet's SNAC data block.

Returns:
this packet's SNAC data block

setFamily

public void setFamily(int family)
Sets this packet's SNAC family code.

Parameters:
family - this packet's new SNAC family code

setCommand

public void setCommand(int command)
Sets this packet's SNAC command subtype.

Parameters:
command - this packet's new SNAC command subtype

setReqid

public void setReqid(long reqid)
Sets this packet's SNAC request ID.

Parameters:
reqid - this packet's new SNAC request ID

setFlag1

public void setFlag1(short flag1)
Sets this packet's first SNAC flag byte.

Parameters:
flag1 - this packet's new first SNAC flag byte

setFlag2

public void setFlag2(short flag2)
Sets this packet's second SNAC flag byte.

Parameters:
flag2 - this packet's new second SNAC flag byte

setData

public void setData(ByteBlock data)
Sets this packet's SNAC data block.

Parameters:
data - this packet's new SNAC data block

isChanged

public boolean isChanged()
Returns true if this object has been modified since its creation (via one of the set methods).

Returns:
whether this object has been modified since its creation

toSnacPacket

public SnacPacket toSnacPacket()
Returns a SNAC packet object with the same properties as this object.

Returns:
a SNAC packet object representing this object

toString

public java.lang.String toString()