net.rim.pushsdk.subscription
Class SubscriberPartial

java.lang.Object
  extended by net.rim.pushsdk.subscription.SubscriberPartial
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Subscriber

public class SubscriberPartial
extends Object
implements Serializable

Represents a subscriber to a push application, with only a subset of the subscriber's details. This class is particularly useful for findBy methods which do not require that a full object be returned.

Author:
mdandrea
See Also:
Serialized Form

Field Summary
protected  String address
          The address (e.g.
protected  SubscriberStatus status
          The status of a subscriber.
protected  SubscriberPrimaryKey subscriberPrimaryKey
          The primary key of a subscriber.
protected  SubscriberType type
          The type of a subscriber.
 
Constructor Summary
SubscriberPartial()
          Constructs a subscriber to a push application with partial subscriber details.
SubscriberPartial(SubscriberPartial subscriberPartial)
          Copy Constructor.
SubscriberPartial(SubscriberPrimaryKey subscriberPrimaryKey)
          Constructs a subscriber to a push application with partial subscriber details.
SubscriberPartial(SubscriberPrimaryKey subscriberPrimaryKey, String address)
          Constructs a subscriber to a push application with partial subscriber details.
 
Method Summary
 boolean equals(Object obj)
          Returns true if two subscriber partials are found to be equal and false otherwise.
 String getAddress()
          Gets the current value of the subscriber's address (e.g.
 String getId()
          Gets the current value of the subscriber id from the primary key.
 String getPushApplicationId()
          Gets the current value of the id of the subscriber's push application from the primary key.
 SubscriberStatus getStatus()
          Gets the current status of the subscriber.
 SubscriberPrimaryKey getSubscriberPrimaryKey()
          Gets the current value of the subscriber's primary key.
 SubscriberType getType()
          Gets the type of the subscriber.
 int hashCode()
          Returns a hashcode for this subscriber partial.
 void setAddress(String address)
          Sets the current value of the subscriber's address (e.g.
 void setStatus(SubscriberStatus status)
          Sets the current status of the subscriber.
 void setSubscriberPrimaryKey(SubscriberPrimaryKey subscriberPrimaryKey)
          Sets the current value of the subscriber's primary key.
 void setType(SubscriberType type)
          Set the type of the subscriber.
 String toString()
          Constructs a String with all attributes in name = value format.
 void validate()
          Validates a subscriber (with partial details) by verifying that it has i) a non-null push application id, ii) a non-null address, iii) a non-null subscriber id, iv) a non-null subscriber status, and v) a non-null type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

subscriberPrimaryKey

protected SubscriberPrimaryKey subscriberPrimaryKey
The primary key of a subscriber.


address

protected String address
The address (e.g. PIN or email address) of a subscriber.


status

protected SubscriberStatus status
The status of a subscriber.


type

protected SubscriberType type
The type of a subscriber.

Since:
1.1
Constructor Detail

SubscriberPartial

public SubscriberPartial(SubscriberPartial subscriberPartial)
Copy Constructor.

Parameters:
subscriberPartial - a SubscriberPartial object

SubscriberPartial

public SubscriberPartial()
Constructs a subscriber to a push application with partial subscriber details.


SubscriberPartial

public SubscriberPartial(SubscriberPrimaryKey subscriberPrimaryKey,
                         String address)
Constructs a subscriber to a push application with partial subscriber details.

Parameters:
subscriberPrimaryKey - the primary key of a subscriber
address - the address (e.g. PIN or email address) of a subscriber

SubscriberPartial

public SubscriberPartial(SubscriberPrimaryKey subscriberPrimaryKey)
Constructs a subscriber to a push application with partial subscriber details.

Parameters:
subscriberPrimaryKey - the primary key of a subscriber
Method Detail

getStatus

public SubscriberStatus getStatus()
Gets the current status of the subscriber.

Returns:
the subscriber's status

setStatus

public void setStatus(SubscriberStatus status)
Sets the current status of the subscriber.

Parameters:
status - the subscriber's status

getType

public SubscriberType getType()
Gets the type of the subscriber.

Returns:
the subscriber's type
Since:
1.1

setType

public void setType(SubscriberType type)
Set the type of the subscriber.

Parameters:
type - s the subscriber's type
Since:
1.1

getAddress

public String getAddress()
Gets the current value of the subscriber's address (e.g. PIN or email address).

Returns:
the subscriber's address

setAddress

public void setAddress(String address)
Sets the current value of the subscriber's address (e.g. PIN or email address).

Parameters:
address - the subscriber's address

getSubscriberPrimaryKey

public SubscriberPrimaryKey getSubscriberPrimaryKey()
Gets the current value of the subscriber's primary key.

Returns:
the subscriber's primary key

setSubscriberPrimaryKey

public void setSubscriberPrimaryKey(SubscriberPrimaryKey subscriberPrimaryKey)
Sets the current value of the subscriber's primary key.

Parameters:
subscriberPrimaryKey - the subscriber's primary key

getId

public String getId()
Gets the current value of the subscriber id from the primary key.

Returns:
the subscriber id

getPushApplicationId

public String getPushApplicationId()
Gets the current value of the id of the subscriber's push application from the primary key.

Returns:
the push application id

validate

public void validate()
Validates a subscriber (with partial details) by verifying that it has i) a non-null push application id, ii) a non-null address, iii) a non-null subscriber id, iv) a non-null subscriber status, and v) a non-null type.

Throws:
IllegalArgumentException - if validation fails

hashCode

public int hashCode()
Returns a hashcode for this subscriber partial.

Overrides:
hashCode in class Object
Returns:
a hashcode for this subscriber partial.

equals

public boolean equals(Object obj)
Returns true if two subscriber partials are found to be equal and false otherwise.

Overrides:
equals in class Object
Returns:
whether two subscriber partials are equal

toString

public String toString()
Constructs a String with all attributes in name = value format.

Overrides:
toString in class Object
Returns:
a String representation of this object.


Copyright © 2011 Research In Motion. All Rights Reserved.