You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ie...@apache.org on 2008/11/02 22:22:29 UTC

svn commit: r709937 - in /incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model: Enum.java Name.java

Author: ieb
Date: Sun Nov  2 13:22:28 2008
New Revision: 709937

URL: http://svn.apache.org/viewvc?rev=709937&view=rev
Log:
Finished documenting the model API.

Modified:
    incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Enum.java
    incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Name.java

Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Enum.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Enum.java?rev=709937&r1=709936&r2=709937&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Enum.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Enum.java Sun Nov  2 13:22:28 2008
@@ -26,24 +26,44 @@
 public interface Enum<E extends Enum.EnumKey> {
 
   /**
-   * Set of fields associated with an Enum object
+   * Set of fields associated with an Enum object.
    */
   public static enum Field {
+    /**
+     * The value of the field.
+     */
     VALUE("value"),
+    /**
+     * The display value of the field.
+     */
     DISPLAY_VALUE("displayValue");
 
+    /**
+     * The json representation of the feild enum.
+     */
     private final String jsonString;
 
+    /**
+     * Create a field enum.
+     * @param jsonString the json value of the enum.
+     */
     private Field(String jsonString) {
       this.jsonString = jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
   }
 
+  /**
+   * base interface for keyed Enumerators.
+   */
   public interface EnumKey {
     String getDisplayValue();
   }
@@ -52,30 +72,56 @@
    * public java.lang.Enum for opensocial.Enum.Drinker.
    */
   public enum Drinker implements EnumKey {
-
+    /** Heavy drinker. */
     HEAVILY("HEAVILY", "Heavily"),
+    /** non drinker. */
     NO("NO", "No"),
+    /** occasional drinker. */
     OCCASIONALLY("OCCASIONALLY", "Occasionally"),
+    /** has quit drinking. */
     QUIT("QUIT", "Quit"),
+    /** in the process of quitting. */
     QUITTING("QUITTING", "Quitting"),
+    /** regular drinker. */
     REGULARLY("REGULARLY", "Regularly"),
+    /** drinks socially. */
     SOCIALLY("SOCIALLY", "Socially"),
+    /** yes, a drinker of alchhol. */
     YES("YES", "Yes");
 
+    /**
+     * the Json representation.
+     */
     private final String jsonString;
 
+    /**
+     * the value used for display purposes.
+     */
     private final String displayValue;
 
+    /**
+     * private internal constructor for the enum.
+     * @param jsonString the json representation.
+     * @param displayValue the display value.
+     */
     private Drinker(String jsonString, String displayValue) {
       this.jsonString = jsonString;
       this.displayValue = displayValue;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see org.apache.shindig.social.opensocial.model.Enum.EnumKey#getDisplayValue()
+     */
     public String getDisplayValue() {
       return displayValue;
     }
@@ -85,30 +131,56 @@
    * public java.lang.Enum for opensocial.Enum.Smoker.
    */
   public enum Smoker implements EnumKey {
-
+    /**  A heavy smoker. */
     HEAVILY("HEAVILY", "Heavily"),
+    /** Non smoker. */
     NO("NO", "No"),
+    /** Smokes occasionally. */
     OCCASIONALLY("OCCASIONALLY", "Ocasionally"),
+    /** Has quit smoking. */
     QUIT("QUIT", "Quit"),
+    /** in the process of quitting smoking. */
     QUITTING("QUITTING", "Quitting"),
+    /** regular smoker, but not a heavy smoker. */
     REGULARLY("REGULARLY", "Regularly"),
+    /** smokes socially. */
     SOCIALLY("SOCIALLY", "Socially"),
+    /** yes, a smoker. */
     YES("YES", "Yes");
 
+    /**
+     * The Json representation of the value.
+     */
     private final String jsonString;
 
+    /**
+     * The value used for display purposes.
+     */
     private final String displayValue;
 
+    /**
+     * Create a Smoker enumeration.
+     * @param jsonString the json representation of the value.
+     * @param displayValue the value used for display purposes.
+     */
     private Smoker(String jsonString, String displayValue) {
       this.jsonString = jsonString;
       this.displayValue = displayValue;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see org.apache.shindig.social.opensocial.model.Enum.EnumKey#getDisplayValue()
+     */
     public String getDisplayValue() {
       return displayValue;
     }
@@ -118,59 +190,107 @@
    * public java.lang.Enum for opensocial.Enum.NetworkPresence.
    */
   public enum NetworkPresence implements EnumKey {
-
+    /** Currently Online. */
     ONLINE("ONLINE", "Online"),
+    /** Currently Offline. */
     OFFLINE("OFFLINE", "Offline"),
+    /** Currently online but away. */
     AWAY("AWAY", "Away"),
+    /** In a chat or available to chat. */
     CHAT("CHAT", "Chat"),
+    /** Online, but don't disturb. */
     DND("DND", "Do Not Disturb"),
+    /** Gone away for a longer period of time. */
     XA("XA", "Extended Away");
 
+    /**
+     * The Json representation of the value.
+     */
     private final String jsonString;
 
+    /**
+     * The value used for display purposes.
+     */
     private final String displayValue;
 
+    /**
+     * Create a network presence enum.
+     * @param jsonString the json value.
+     * @param displayValue the display value.
+     */
     private NetworkPresence(String jsonString, String displayValue) {
       this.jsonString = jsonString;
       this.displayValue = displayValue;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see org.apache.shindig.social.opensocial.model.Enum.EnumKey#getDisplayValue()
+     */
     public String getDisplayValue() {
       return displayValue;
     }
   }
 
   /**
-   * public java.lang.Enum for opensocial.Enum.LookingFor
+   * public java.lang.Enum for opensocial.Enum.LookingFor.
    */
   public enum LookingFor implements EnumKey {
-
+    /** Interested in dating. */
     DATING("DATING", "Dating"),
+    /** Looking for friends. */
     FRIENDS("FRIENDS", "Friends"),
+    /** Looking for a relationship. */
     RELATIONSHIP("RELATIONSHIP", "Relationship"),
+    /** Just want to network. */
     NETWORKING("NETWORKING", "Networking"),
+    /** */
     ACTIVITY_PARTNERS("ACTIVITY_PARTNERS", "Activity partners"),
+    /** */
     RANDOM("RANDOM", "Random");
 
+    /**
+     * The Json representation of the value.
+     */
     private final String jsonString;
 
+    /**
+     * The value used for display purposes.
+     */
     private final String displayValue;
 
+    /**
+     * Construct a looking for enum.
+     * @param jsonString the json representation of the enum.
+     * @param displayValue the value used for display purposes.
+     */
     private LookingFor(String jsonString, String displayValue) {
       this.jsonString = jsonString;
       this.displayValue = displayValue;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see org.apache.shindig.social.opensocial.model.Enum.EnumKey#getDisplayValue()
+     */
     public String getDisplayValue() {
       return displayValue;
     }

Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Name.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Name.java?rev=709937&r1=709936&r2=709937&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Name.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Name.java Sun Nov  2 13:22:28 2008
@@ -22,6 +22,7 @@
 import com.google.inject.ImplementedBy;
 
 /**
+ * Base interface for all name objects.
  * see
  * http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Name.Field.html
  *
@@ -31,47 +32,116 @@
 
 public interface Name {
 
+  /**
+   * An enumeration of fields in the json name object.
+   */
   public static enum Field {
+    /**
+     * The additional name.
+     */
     ADDITIONAL_NAME("additionalName"),
+    /**
+     * The family name.
+     */
     FAMILY_NAME("familyName"),
+    /**
+     * The given name.
+     */
     GIVEN_NAME("givenName"),
+    /**
+     * The honorific prefix.
+     */
     HONORIFIC_PREFIX("honorificPrefix"),
+    /**
+     * The honorific suffix.
+     */
     HONORIFIC_SUFFIX("honorificSuffix"),
+    /**
+     * The unstructured name.
+     */
     FORMATTED("formatted");
 
+    /**
+     * the json key for this field.
+     */
     private final String jsonString;
 
+    /**
+     * Construct the a field enum.
+     * @param jsonString the json key for the field.
+     */
     private Field(String jsonString) {
       this.jsonString = jsonString;
     }
 
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Enum#toString()
+     */
     @Override
     public String toString() {
       return this.jsonString;
     }
   }
 
+  /**
+   * @return the name, formatted.
+   */
   String getFormatted();
 
+  /**
+   * set the name formatted.
+   * @param formatted the name, formatted.
+   */
   void setFormatted(String formatted);
 
+  /**
+   * @return get the additional name.
+   */
   String getAdditionalName();
 
+  /**
+   * @param additionalName set the additional name.
+   */
   void setAdditionalName(String additionalName);
 
+  /**
+   * @return the family name.
+   */
   String getFamilyName();
 
+  /**
+   * @param familyName the family name being set.
+   */
   void setFamilyName(String familyName);
 
+  /**
+   * @return the given name.
+   */
   String getGivenName();
 
+  /**
+   * @param givenName the given name to be set.
+   */
   void setGivenName(String givenName);
 
+  /**
+   * @return the honorific prefix.
+   */
   String getHonorificPrefix();
 
+  /**
+   * @param honorificPrefix the honorific prefix to be set.
+   */
   void setHonorificPrefix(String honorificPrefix);
 
+  /**
+   * @return the honorific suffix.
+   */
   String getHonorificSuffix();
 
+  /**
+   * @param honorificSuffix the honorific suffix to set.
+   */
   void setHonorificSuffix(String honorificSuffix);
 }