@SupportedVersions(value=V4_0) public class Birthplace extends PlaceProperty
Defines the location of the person's birth.
Code sample (creating)
VCard vcard = new VCard(); //text Birthplace birthplace = new Birthplace("Maida Vale, London, United Kingdom"); vcard.setBirthplace(birthplace); //geo coordinates birthplace = new Birthplace(51.5274, -0.1899); vcard.setBirthplace(birthplace); //URI birthplace = new Birthplace(); birthplace.setUri("http://en.wikipedia.org/wiki/Maida_Vale"); vcard.setBirthplace(birthplace);
Code sample (retrieving)
VCard vcard = ... Birthplace birthplace = vcard.getBirthplace(); String text = birthplace.getText(); if (text != null) { //property value is plain text } Double latitude = birthplace.getLatitude(); Double longitude = birthplace.getLongitude(); if (latitude != null) { //property value is a set of geo coordinates } String uri = birthplace.getUri(); if (uri != null) { //property value is a URI }
Property name: BIRTHPLACE
Supported versions: 4.0
geoUri, text, uri
group, parameters
Constructor and Description |
---|
Birthplace()
Creates a new birthplace property.
|
Birthplace(Birthplace original)
Copy constructor.
|
Birthplace(double latitude,
double longitude)
Creates a new birthplace property.
|
Birthplace(String text)
Creates a new birthplace property.
|
Modifier and Type | Method and Description |
---|---|
Birthplace |
copy()
Creates a copy of this property object.
|
_validate, equals, getAltId, getGeoUri, getLanguage, getLatitude, getLongitude, getText, getUri, hashCode, setAltId, setCoordinates, setGeoUri, setLanguage, setText, setUri, toStringValues
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, isSupportedBy, removeParameter, setGroup, setParameter, setParameters, toString, validate
public Birthplace()
public Birthplace(double latitude, double longitude)
latitude
- the latitude coordinate of the placelongitude
- the longitude coordinate of the placepublic Birthplace(String text)
text
- a text value representing the placepublic Birthplace(Birthplace original)
original
- the property to make a copy ofpublic Birthplace 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
Copyright © 2012–2023 Michael Angstadt. All rights reserved.