@SupportedVersions(value={V3_0,V4_0}) public class Impp extends VCardProperty implements HasAltId
Defines an instant messenger handle. The handle is represented as a URI in
the format "<PROTOCOL>:<HANDLE>
". For example, a Yahoo! Messenger
handle of "johndoe@yahoo.com" would look like this:
"ymsgr:johndoe@yahoo.com".
Code sample
VCard vcard = new VCard(); //URI Impp impp = new Impp("aim:johndoe@aol.com"); vcard.addImpp(impp); //static factory methods impp = Impp.msn("janedoe@msn.com"); vcard.addImpp(impp);
Property name: IMPP
Supported versions: 3.0, 4.0
group, parameters
Constructor and Description |
---|
Impp(Impp original)
Copy constructor.
|
Impp(String uri)
Creates an IMPP property.
|
Impp(String protocol,
String handle)
Creates an IMPP property.
|
Impp(URI uri)
Creates an IMPP property.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_validate(List<ValidationWarning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
static Impp |
aim(String handle)
Creates an IMPP property that contains a AOL Instant Messenger handle.
|
Impp |
copy()
Creates a copy of this property object.
|
boolean |
equals(Object obj) |
String |
getAltId()
Gets the property's ALTID parameter.
|
String |
getHandle()
Gets the IM handle.
|
String |
getMediaType()
Gets the MEDIATYPE parameter.
|
List<Pid> |
getPids()
Gets the list that stores this property's PID (property ID) parameter
values.
|
Integer |
getPref()
Gets this property's preference value.
|
String |
getProtocol()
Gets the IM protocol.
|
List<ImppType> |
getTypes()
Gets the list that stores this property's IMPP types (TYPE parameters).
|
URI |
getUri()
Gets the IM URI.
|
int |
hashCode() |
static Impp |
icq(String handle)
Creates an IMPP property that contains an ICQ handle.
|
static Impp |
irc(String handle)
Creates an IMPP property that contains an IRC handle.
|
boolean |
isAim()
Determines if this IMPP property contains an AOL Instant Messenger
handle.
|
boolean |
isIcq()
Determines if this IMPP property contains an ICQ handle.
|
boolean |
isIrc()
Determines if this IMPP property contains an IRC handle.
|
boolean |
isMsn()
Determines if this IMPP property contains an MSN handle.
|
boolean |
isSip()
Determines if this IMPP property contains a Session Initiation Protocol
handle.
|
boolean |
isSkype()
Determines if this IMPP property contains a Skype handle.
|
boolean |
isXmpp()
Determines if this IMPP property contains an Extensible Messaging and
Presence Protocol handle.
|
boolean |
isYahoo()
Determines if this IMPP property contains a Yahoo! Messenger handle.
|
static Impp |
msn(String handle)
Creates an IMPP property that contains an MSN IMPP property.
|
void |
setAltId(String altId)
Sets the property's ALTID parameter.
|
void |
setMediaType(String mediaType)
Sets the MEDIATYPE parameter.
|
void |
setPref(Integer pref)
Sets this property's preference value.
|
void |
setUri(String uri)
Sets the IM URI.
|
void |
setUri(String protocol,
String handle)
Sets the IM URI.
|
void |
setUri(URI uri)
Sets the IM URI.
|
static Impp |
sip(String handle)
Creates an IMPP property that contains a Session Initiation Protocol
handle.
|
static Impp |
skype(String handle)
Creates an IMPP property that contains a Skype handle.
|
protected Map<String,Object> |
toStringValues()
Gets string representations of the class's fields for the
VCardProperty.toString() method. |
static Impp |
xmpp(String handle)
Creates an IMPP property that contains an Extensible Messaging and
Presence Protocol handle.
|
static Impp |
yahoo(String handle)
Creates an IMPP property that contains a Yahoo! Messenger handle.
|
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, isSupportedBy, removeParameter, setGroup, setParameter, setParameters, toString, validate
public Impp(String uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")IllegalArgumentException
- if the URI is not a valid URIpublic Impp(URI uri)
uri
- the IM URI (e.g. "aim:johndoe@aol.com")public Impp(String protocol, String handle)
protocol
- the IM protocol (e.g. "aim")handle
- the IM handle (e.g. "johndoe@aol.com")public static Impp aim(String handle)
handle
- the IM handlepublic boolean isAim()
public static Impp yahoo(String handle)
handle
- the IM handlepublic boolean isYahoo()
public static Impp msn(String handle)
handle
- the IM handlepublic boolean isMsn()
public static Impp icq(String handle)
handle
- the IM handlepublic boolean isIcq()
public static Impp irc(String handle)
handle
- the IM handlepublic boolean isIrc()
public static Impp sip(String handle)
handle
- the IM handlepublic boolean isSip()
public static Impp skype(String handle)
handle
- the IM handlepublic boolean isSkype()
public static Impp xmpp(String handle)
handle
- the IM handlepublic boolean isXmpp()
public void setUri(String uri)
uri
- the IM URI (e.g. "aim:theuser@aol.com")IllegalArgumentException
- if the URI is not a valid URIpublic void setUri(URI uri)
uri
- the IM URI (e.g. "aim:theuser@aol.com")public void setUri(String protocol, String handle)
protocol
- the IM protocol (e.g. "aim")handle
- the IM handle (e.g. "theuser@aol.com")public String getProtocol()
setUri(String, String)
to set the
protocol.public String getHandle()
setUri(String, String)
to set the
handle.public List<ImppType> getTypes()
public String getMediaType()
Supported versions: 4.0
public void setMediaType(String mediaType)
Supported versions: 4.0
mediaType
- the media type or null to removepublic List<Pid> getPids()
VCardProperty
Gets the list that stores this property's PID (property ID) parameter values.
PIDs can exist on any property where multiple instances are allowed (such
as Email
or Address
, but not StructuredName
because only 1 instance of this property is allowed per vCard).
When used in conjunction with the ClientPidMap
property, it
allows an individual property instance to be uniquely identifiable. This
feature is made use of when two different versions of the same vCard have
to be merged together (called "synchronizing").
Supported versions: 4.0
public Integer getPref()
VCardProperty
Gets this property's preference value. The lower this number is, the more "preferred" the property instance is compared with other properties of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the Address
on the second row is the most
preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2:;;1600 Amphitheatre Parkway;Mountain View;CA;94043 ADR;TYPE=work;PREF=1:;;One Microsoft Way;Redmond;WA;98052 ADR;TYPE=home:;;123 Maple St;Hometown;KS;12345
Supported versions: 4.0
public void setPref(Integer pref)
VCardProperty
Sets this property's preference value. The lower this number is, the more "preferred" the property instance is compared with other properties of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the Address
on the second row is the most
preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2:;;1600 Amphitheatre Parkway;Mountain View;CA;94043 ADR;TYPE=work;PREF=1:;;One Microsoft Way;Redmond;WA;98052 ADR;TYPE=home:;;123 Maple St;Hometown;KS;12345
Supported versions: 4.0
pref
- the preference value or null to removepublic String getAltId()
HasAltId
Supported versions: 4.0
getAltId
in interface HasAltId
VCardParameters.getAltId()
public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId
in interface HasAltId
altId
- the ALTID or null to removeVCardParameters.setAltId(java.lang.String)
protected void _validate(List<ValidationWarning> warnings, VCardVersion version, VCard vcard)
VCardProperty
_validate
in class VCardProperty
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs toprotected Map<String,Object> toStringValues()
VCardProperty
Gets string representations of the class's fields for the
VCardProperty.toString()
method.
Meant to be overridden by child classes. The default implementation returns an empty map.
toStringValues
in class VCardProperty
public Impp copy()
VCardProperty
Creates a copy of this property object.
The default implementation of this method uses reflection to look for a copy constructor. Child classes SHOULD override this method to avoid the performance overhead involved in using reflection.
The child class's copy constructor, if present, MUST invoke the
VCardProperty.VCardProperty(VCardProperty)
super constructor to ensure that
the group name and parameters are also copied.
This method MUST be overridden by the child class if the child class does
not have a copy constructor. Otherwise, an
UnsupportedOperationException
will be thrown when an attempt is
made to copy the property (such as in the VCard
class's copy constructor
).
copy
in class VCardProperty
public int hashCode()
hashCode
in class VCardProperty
public boolean equals(Object obj)
equals
in class VCardProperty
Copyright © 2012–2023 Michael Angstadt. All rights reserved.