org.sciplore.resources
Class Contact

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.Contact

@Entity
public class Contact
extends Resource

Resource class for contacts.

Author:
Mario Lipinski <lipinski@sciplore.org>
See Also:
Resource

Field Summary
static short CONTACT_TYPE_BUSINESS
          Bitmask for business contact type.
static short CONTACT_TYPE_BUSINESS_EMAIL
          Bitmask for business email contact type.
static short CONTACT_TYPE_BUSINESS_HOMEPAGE
          Bitmask for business homepage type.
static short CONTACT_TYPE_EMAIL
          Bitmask for email contact type.
static short CONTACT_TYPE_HOMEPAGE
          Bitmask for homepage contact type.
static short CONTACT_TYPE_PRIVATE
          Bitmask for private contact type.
static short CONTACT_TYPE_PRIVATE_EMAIL
          Bitmask for private email contact type.
static short CONTACT_TYPE_PRIVATE_HOMEPAGE
          Bitmask for private homepage contact type.
 
Constructor Summary
Contact()
          Contruct an empty Contact object.
Contact(Person person, String uri, Short type)
          Construct a Contact object from Person, URI and type.
Contact(String uri, Short type)
          Construct a Contact object from URI and Type.
 
Method Summary
static Contact getContact(Contact c)
          Returns a Contact object from the database from a Contact object.
static Contact getContact(Integer id)
          Returns a Contact object from the database for an identifier.
static Contact getContact(Person p, String uri)
          Returns a Contact object fromt he database for a Person and an uri.
 String getDescription()
          Returns the description.
 Integer getId()
          Returns the identifier.
 Short getMedia()
          Deprecated. use type with bitmasks instead
 Person getPerson()
          Returns the Person.
 Short getType()
          Returns the type.
 String getUri()
          Returns the URI.
 Short getValid()
          Returns information about the validity of the record.
 void setDescription(String description)
          Sets the description.
 void setId(Integer id)
          Sets the identifier.
 void setMedia(Short media)
          Deprecated. use type with bitmasks instead
 void setPerson(Person person)
          Sets the Person.
 void setType(Short type)
          Sets the type.
 void setUri(String uri)
          Sets the URI.
 void setValid(Short valid)
          Sets information about the validity of the record.
static Contact sync(Contact co)
          Synchronizes an Contact object with a record from the database.
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACT_TYPE_PRIVATE

public static final short CONTACT_TYPE_PRIVATE
Bitmask for private contact type.

See Also:
Constant Field Values

CONTACT_TYPE_BUSINESS

public static final short CONTACT_TYPE_BUSINESS
Bitmask for business contact type.

See Also:
Constant Field Values

CONTACT_TYPE_EMAIL

public static final short CONTACT_TYPE_EMAIL
Bitmask for email contact type.

See Also:
Constant Field Values

CONTACT_TYPE_HOMEPAGE

public static final short CONTACT_TYPE_HOMEPAGE
Bitmask for homepage contact type.

See Also:
Constant Field Values

CONTACT_TYPE_PRIVATE_EMAIL

public static final short CONTACT_TYPE_PRIVATE_EMAIL
Bitmask for private email contact type.

See Also:
CONTACT_TYPE_PRIVATE, CONTACT_TYPE_EMAIL, Constant Field Values

CONTACT_TYPE_PRIVATE_HOMEPAGE

public static final short CONTACT_TYPE_PRIVATE_HOMEPAGE
Bitmask for private homepage contact type.

See Also:
CONTACT_TYPE_PRIVATE, CONTACT_TYPE_HOMEPAGE, Constant Field Values

CONTACT_TYPE_BUSINESS_EMAIL

public static final short CONTACT_TYPE_BUSINESS_EMAIL
Bitmask for business email contact type.

See Also:
CONTACT_TYPE_BUSINESS, CONTACT_TYPE_EMAIL, Constant Field Values

CONTACT_TYPE_BUSINESS_HOMEPAGE

public static final short CONTACT_TYPE_BUSINESS_HOMEPAGE
Bitmask for business homepage type.

See Also:
CONTACT_TYPE_BUSINESS, CONTACT_TYPE_HOMEPAGE, Constant Field Values
Constructor Detail

Contact

public Contact()
Contruct an empty Contact object.


Contact

public Contact(Person person,
               String uri,
               Short type)
Construct a Contact object from Person, URI and type.

Parameters:
person - the Person
uri - the URI
type - the type
See Also:
Person

Contact

public Contact(String uri,
               Short type)
Construct a Contact object from URI and Type.

Parameters:
uri - the URI
type - the type
Method Detail

getContact

public static Contact getContact(Contact c)
Returns a Contact object from the database from a Contact object.

Parameters:
c - the contact object
Returns:
the contact object from database or null if not found

getContact

public static Contact getContact(Integer id)
Returns a Contact object from the database for an identifier.

Parameters:
id - the identifier
Returns:
the Contact object from the database or null if not found

getContact

public static Contact getContact(Person p,
                                 String uri)
Returns a Contact object fromt he database for a Person and an uri.

Parameters:
p - the Person
uri - the URI
Returns:
the Contact object from the database or null if not found
See Also:
Person

sync

public static Contact sync(Contact co)
Synchronizes an Contact object with a record from the database. If the object does not exist, it is added to the database. In any case related objects are synchronized as well.

Parameters:
co - the Contact
Returns:
the synchronized Contact which is stored in the database

getDescription

public String getDescription()
Returns the description.

Returns:
the description

getId

public Integer getId()
Returns the identifier.

Returns:
the identifier

getMedia

@Deprecated
public Short getMedia()
Deprecated. use type with bitmasks instead

Returns the media.

Returns:
the media

getPerson

public Person getPerson()
Returns the Person.

Returns:
the Person
See Also:
Person

getType

public Short getType()
Returns the type.

Returns:
the type

getUri

public String getUri()
Returns the URI.

Returns:
the uri

getValid

public Short getValid()
Returns information about the validity of the record.

Returns:
information about the validity of the record

setDescription

public void setDescription(String description)
Sets the description.

Parameters:
description - the description

setId

public void setId(Integer id)
Sets the identifier.

Parameters:
id - the identifier

setMedia

@Deprecated
public void setMedia(Short media)
Deprecated. use type with bitmasks instead

Sets the media.

Parameters:
media - the media

setPerson

public void setPerson(Person person)
Sets the Person.

Parameters:
person - the Person

setType

public void setType(Short type)
Sets the type.

Parameters:
type - the type

setUri

public void setUri(String uri)
Sets the URI.

Parameters:
uri - the uri

setValid

public void setValid(Short valid)
Sets information about the validity of the record.

Parameters:
valid - information about the validity of the record.