org.mobicents.protocols.smpp
Class Address

java.lang.Object
  extended by org.mobicents.protocols.smpp.Address
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ErrorAddress

public class Address
extends Object
implements Serializable

Object representing a Short Message Entity's address. An address consists of a Type Of Number, a Numbering Plan Indicator and an address.

See Also:
com.adenki.smpp.util.GSMConstants, Serialized Form

Constructor Summary
Address()
          Create a new Address with all nul values.
Address(int ton, int npi, String address)
          Create a new Address.
 
Method Summary
 boolean equals(Object obj)
          Test for equality.
 String getAddress()
          Get the address.
 int getLength()
          Get the number of bytes this object would encode to.
 int getNPI()
          Get the Numbering Plan Indicator.
 int getTON()
          Get the Type Of Number.
 int hashCode()
          Get a unique hash code for this address.
 void readFrom(PacketDecoder decoder)
          TODO: doc
 void setAddress(String address)
          Set the address.
 void setNPI(int npi)
          Set the Numbering Plan Indicator.
 void setTON(int ton)
          Set the Type of Number.
 String toString()
           
 void writeTo(PacketEncoder encoder)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address()
Create a new Address with all nul values. TON will be 0, NPI will be 0 and the address field will be blank.


Address

public Address(int ton,
               int npi,
               String address)
Create a new Address.

Parameters:
ton - The Type Of Number.
npi - The Numbering Plan Indicator.
address - The address.
Method Detail

getTON

public int getTON()
Get the Type Of Number.


setTON

public void setTON(int ton)
Set the Type of Number.


getNPI

public int getNPI()
Get the Numbering Plan Indicator.


setNPI

public void setNPI(int npi)
Set the Numbering Plan Indicator.


getAddress

public String getAddress()
Get the address.


setAddress

public void setAddress(String address)
Set the address.


hashCode

public int hashCode()
Get a unique hash code for this address.

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Test for equality. Two address objects are equal if their TON, NPI and address fields are equal.

Overrides:
equals in class Object

getLength

public int getLength()
Get the number of bytes this object would encode to.


writeTo

public void writeTo(PacketEncoder encoder)
             throws IOException
Throws:
IOException

readFrom

public void readFrom(PacketDecoder decoder)
TODO: doc


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Mobicents. All Rights Reserved.