public final class

ContactResult

extends Object
java.lang.Object
   ↳ com.neomades.contact.ContactResult

Class Overview

Represents object return by ContactResultListener listener when operations of ContactManager or ContactDatabase are launched. This object contains all informations form the operation as :

Summary

Constants
int TYPE_ADD addContact(ContactResultListener), addContact(Contact, ContactResultListener) or save(Contact, ContactResultListener) operation type
int TYPE_DELETE delete(Contact, ContactResultListener) operation type
int TYPE_EDIT editContact(Contact, ContactResultListener) or save(Contact, ContactResultListener) operation type
int TYPE_GET_ALL getAllContacts(ContactResultListener) operation type
int TYPE_PICK_SINGLE pickSingleContact(ContactResultListener) operation type
int TYPE_SHOW showContact(Contact, ContactResultListener) operation type
Public Methods
Object getData()
Returns operation's associated data.
String getMessage()
Returns the associated message.
int getResultType()
Returns the associated result type.
boolean isCancelled()
Returns true if the operation has been cancelled by the user, false if the operation is a success or has failed.
boolean isSuccess()
Returns true if the operation is a success, false if there is an error or has been cancelled.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int TYPE_ADD

public static final int TYPE_DELETE

Constant Value: 7 (0x00000007)

public static final int TYPE_EDIT

public static final int TYPE_GET_ALL

Constant Value: 6 (0x00000006)

public static final int TYPE_PICK_SINGLE

Constant Value: 2 (0x00000002)

public static final int TYPE_SHOW

Constant Value: 5 (0x00000005)

Public Methods

public Object getData ()

Returns operation's associated data.

If getResultType()'s return is TYPE_SHOW, it returns null.
Otherwise it returns a single Contact object.

Returns
  • an Object (a Contact or a Vector). If the user doesn't select any contact, it returns null.

public String getMessage ()

Returns the associated message.

If isSuccess() returns true or getResultType() returns TYPE_SHOW, the message is "SUCCESS".
If isCancelled() returns true, the message is "CANCELLED".
Otherwise, returns the error message details.

Returns
  • a message

public int getResultType ()

Returns the associated result type.

TYPE_ADD, TYPE_PICK_SINGLE, TYPE_EDIT or TYPE_SHOW.

Returns
  • the result type constant

public boolean isCancelled ()

Returns true if the operation has been cancelled by the user, false if the operation is a success or has failed.

Returns

public boolean isSuccess ()

Returns true if the operation is a success, false if there is an error or has been cancelled.

Note: If getResultType() returns TYPE_SHOW, the method returns always true.

Returns