NeedsExamples
opensocial.Enum
Base interface for all enum objects. This class allows containers to use constants for fields that are usually have a common set of values. There are two main ways to use this class. If your gadget just wants to display how much of a smoker someone is, it can simply use: html = "This person smokes: " + person.getField('smoker').getValue(); This value field will be correctly set up by the container. This is a place where the container can even localize the value for the gadget so that it always shows the right thing. If your gadget wants to have some logic around the smoker field it can use: if (person.getField('smoker').getKey() != "NO") { //gadget logic here } Note: The key may be null if the person's smoker field cannot be coerced into one of the standard enum types. The value, on the other hand, is never null.
Methods
opensocial.Enum.getDisplayValue
;String getDisplayValue()
Returns
TypeDescription |
String |
The enum's value. |
Description
The value of this enum. This will be a user displayable string. If the container supports localization, the string will be localized.
opensocial.Enum.getKey
;String getKey()
Returns
TypeDescription |
String |
The enum's key. This should be one of the defined enums below. |
Description
Use this for logic within your gadget. If they key is null then the value does not fit in the defined enums.
opensocial.Enum.Drinker
The enum keys used by the drinker field. See also: opensocial.Person.Field.Drinker
opensocial.Enum.Drinker.HEAVILY
This field may be used interchangeably with the string 'HEAVILY'.
opensocial.Enum.Drinker.NO
This field may be used interchangeably with the string 'NO'.
opensocial.Enum.Drinker.OCCASIONALLY
This field may be used interchangeably with the string 'OCCASIONALLY'.
opensocial.Enum.Drinker.QUIT
This field may be used interchangeably with the string 'QUIT'.
opensocial.Enum.Drinker.QUITTING
This field may be used interchangeably with the string 'QUITTING'.
opensocial.Enum.Drinker.REGULARLY
This field may be used interchangeably with the string 'REGULARLY'.
opensocial.Enum.Drinker.SOCIALLY
This field may be used interchangeably with the string 'SOCIALLY'.
opensocial.Enum.Drinker.YES
This field may be used interchangeably with the string 'YES'.
opensocial.Enum.Gender
The enum keys used by the gender field. See also: opensocial.Person.Field.Gender
opensocial.Enum.Gender.FEMALE
This field may be used interchangeably with the string 'FEMALE'.
opensocial.Enum.Gender.MALE
This field may be used interchangeably with the string 'MALE'.
opensocial.Enum.LookingFor
The enum keys used by the lookingFor field. See also: opensocial.Person.Field.LookingFor
opensocial.Enum.LookingFor.ACTIVITY_PARTNERS
<static> Member of: opensocial.Enum.LookingFor.ACTIVITY_PARTNERS This field may be used interchangeably with the string 'ACTIVITY_PARTNERS'.
opensocial.Enum.LookingFor.DATING
This field may be used interchangeably with the string 'DATING'.
opensocial.Enum.LookingFor.FRIENDS
This field may be used interchangeably with the string 'FRIENDS'.
opensocial.Enum.LookingFor.NETWORKING
This field may be used interchangeably with the string 'NETWORKING'.
opensocial.Enum.LookingFor.RANDOM
This field may be used interchangeably with the string 'RANDOM'.
opensocial.Enum.LookingFor.RELATIONSHIP
This field may be used interchangeably with the string 'RELATIONSHIP'.
opensocial.Enum.Presence
The enum keys used by the networkPresence field. See also: opensocial.Person.Field.NetworkPresence
opensocial.Enum.Presence.AWAY
The entity or resource is temporarily away. This field may be used interchangeably with the string 'AWAY'.
opensocial.Enum.Presence.CHAT
The entity or resource is actively interested in chatting. This field may be used interchangeably with the string 'CHAT'.
opensocial.Enum.Presence.DND
The entity or resource is busy (dnd = "Do Not Disturb"). This field may be used interchangeably with the string 'DND'.
opensocial.Enum.Presence.OFFLINE
The entity or resource is off line. This field may be used interchangeably with the string 'OFFLINE'.
opensocial.Enum.Presence.ONLINE
The entity or resource is on line. This field may be used interchangeably with the string 'ONLINE'.
opensocial.Enum.Presence.XA
The entity or resource is away for an extended period (xa = "eXtended Away"). This field may be used interchangeably with the string 'XA'.
opensocial.Enum.Smoker
The enum keys used by the smoker field. See also: opensocial.Person.Field.Smoker
opensocial.Enum.Smoker.HEAVILY
This field may be used interchangeably with the string 'HEAVILY'.
opensocial.Enum.Smoker.NO
This field may be used interchangeably with the string 'NO'.
opensocial.Enum.Smoker.OCCASIONALLY
This field may be used interchangeably with the string 'OCCASIONALLY'.
opensocial.Enum.Smoker.QUIT
This field may be used interchangeably with the string 'QUIT'.
opensocial.Enum.Smoker.QUITTING
This field may be used interchangeably with the string 'QUITTING'.
opensocial.Enum.Smoker.REGULARLY
This field may be used interchangeably with the string 'REGULARLY'.
opensocial.Enum.Smoker.SOCIALLY
This field may be used interchangeably with the string 'SOCIALLY'.
opensocial.Enum.Smoker.YES
This field may be used interchangeably with the string 'YES'.
{{ JsApiAlphaList_(v0.9) }}