uk.co.keang.callerid.driver
Class CallerIDMessage

java.lang.Object
  extended by uk.co.keang.callerid.driver.CallerIDMessage

public class CallerIDMessage
extends java.lang.Object

Decodes a byte array into caller id values ie the message

Version:
1.0 - 15 Jan 2014
Author:
Keang

Field Summary
(package private) static byte CALL_TYPE
           
(package private) static byte CALLER_ID
           
(package private) static byte CALLING_NAME
           
(package private) static byte CALLING_NUMBER
           
(package private) static byte MSG_WAITING
           
(package private) static byte RINGBACK
           
(package private) static byte TIMEDATE
           
(package private) static byte UNAVAILABLE
           
(package private) static byte VOICE
           
(package private) static byte WHY_NO_NUMBER
           
(package private) static byte WITHHELD
           
 
Constructor Summary
CallerIDMessage(byte[] data)
          The data to decode
 
Method Summary
(package private)  void decode(byte[] data)
          Decodes the given data
 CallType getCallType()
          Gets the type of call
 java.util.Date getDate()
          Gets the callers date and time
 java.lang.String getName()
          Gets the callers name if there is one
 java.lang.String getNumber()
          Gets the callers telephone number if there is one
 WhyNoNumber getWhyNoNumber()
          Gets the reason why there is no phone number
 boolean hasNumber()
          true if the message contains a number
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CALLER_ID

static final byte CALLER_ID
See Also:
Constant Field Values

TIMEDATE

static final byte TIMEDATE
See Also:
Constant Field Values

CALLING_NUMBER

static final byte CALLING_NUMBER
See Also:
Constant Field Values

WHY_NO_NUMBER

static final byte WHY_NO_NUMBER
See Also:
Constant Field Values

CALLING_NAME

static final byte CALLING_NAME
See Also:
Constant Field Values

CALL_TYPE

static final byte CALL_TYPE
See Also:
Constant Field Values

WITHHELD

static final byte WITHHELD
See Also:
Constant Field Values

UNAVAILABLE

static final byte UNAVAILABLE
See Also:
Constant Field Values

VOICE

static final byte VOICE
See Also:
Constant Field Values

RINGBACK

static final byte RINGBACK
See Also:
Constant Field Values

MSG_WAITING

static final byte MSG_WAITING
See Also:
Constant Field Values
Constructor Detail

CallerIDMessage

public CallerIDMessage(byte[] data)
The data to decode

Parameters:
data - the data
Method Detail

decode

void decode(byte[] data)
      throws java.lang.IllegalArgumentException
Decodes the given data

Parameters:
data - the data
Throws:
java.lang.IllegalArgumentException - if the data does not contain valid caller ID data

hasNumber

public boolean hasNumber()
true if the message contains a number

Returns:
true if there is a phone number

getName

public java.lang.String getName()
Gets the callers name if there is one

Returns:
the callers name or null

getNumber

public java.lang.String getNumber()
Gets the callers telephone number if there is one

Returns:
the callers telephone number or null

getDate

public java.util.Date getDate()
Gets the callers date and time

Returns:
the callers date and time or null

getWhyNoNumber

public WhyNoNumber getWhyNoNumber()
Gets the reason why there is no phone number

Returns:
The reason or null if there is a phone number

getCallType

public CallType getCallType()
Gets the type of call

Returns:
the call type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object