abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1209204 - in /abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model: Verb.java objects/Objects.java objects/ReviewObject.java
Date Thu, 01 Dec 2011 19:37:08 GMT
Author: jmsnell
Date: Thu Dec  1 19:37:00 2011
New Revision: 1209204

URL: http://svn.apache.org/viewvc?rev=1209204&view=rev
Log:
Additional minor updates to objects.. just general cleanup at this point....

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java?rev=1209204&r1=1209203&r2=1209204&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
Thu Dec  1 19:37:00 2011
@@ -70,7 +70,7 @@ public abstract class Verb {
  public static final Verb UNSAVE = new Verb("unsave") {};
  public static final Verb UPDATE = new Verb("update") {};
  
- 
+ public static final Verb COMMENT = new Verb("comment") {};
  public static final Verb PURCHASE = new Verb("purchase") {};  
  public static final Verb CONSUME = new Verb("consume") {};
  public static final Verb HOST = new Verb("host") {};

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java?rev=1209204&r1=1209203&r2=1209204&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java
Thu Dec  1 19:37:00 2011
@@ -107,10 +107,14 @@ public final class Objects {
   /**
    * Create an anonymous AS Object (no objectType property)
    */
-  public static ASObjectBuilder anonymousObject(String id) {
+  public static ASObjectBuilder untypedObject(String id) {
     return ASObject.makeObject().id(id);
   }
   
+  public static ASObjectBuilder untypedObject(String id, String displayName) {
+    return ASObject.makeObject().id(id).displayName(displayName);
+  }
+  
   public static final ASObject DISCONTINUED = DISCONTINUED().get();
   public static final ASObject INSTOCK = INSTOCK().get();
   public static final ASObject INSTOREONLY = INSTOREONLY().get();
@@ -126,55 +130,55 @@ public final class Objects {
   public static final ASObject USED = USED().get();
   
   public static ASObjectBuilder DISCONTINUED() {
-    return anonymousObject("discontinued");
+    return untypedObject("discontinued");
   }
   
   public static ASObjectBuilder INSTOCK() {
-    return anonymousObject("in-stock");
+    return untypedObject("in-stock");
   }
   
   public static ASObjectBuilder INSTOREONLY() {
-    return anonymousObject("in-store-only");
+    return untypedObject("in-store-only");
   }
   
   public static ASObjectBuilder ONLINEONLY() {
-    return anonymousObject("online-only");
+    return untypedObject("online-only");
   }
   
   public static ASObjectBuilder OUTOFSTOCK() {
-    return anonymousObject("out-of-stock");
+    return untypedObject("out-of-stock");
   }
   
   public static ASObjectBuilder PREORDER() {
-    return anonymousObject("pre-order");
+    return untypedObject("pre-order");
   }
   
   public static ASObjectBuilder EBOOK() {
-    return anonymousObject("ebook");
+    return untypedObject("ebook");
   }
   
   public static ASObjectBuilder HARDCOVER() {
-    return anonymousObject("hardcover");
+    return untypedObject("hardcover");
   }
   
   public static ASObjectBuilder PAPERBACK() {
-    return anonymousObject("paperback");
+    return untypedObject("paperback");
   }
   
   public static ASObjectBuilder DAMAGED() {
-    return anonymousObject("damaged");
+    return untypedObject("damaged");
   }
   
   public static ASObjectBuilder NEW() {
-    return anonymousObject("new");
+    return untypedObject("new");
   }
   
   public static ASObjectBuilder REFURBISHED() {
-    return anonymousObject("refurbished");
+    return untypedObject("refurbished");
   }
   
   public static ASObjectBuilder USED() {
-    return anonymousObject("used");
+    return untypedObject("used");
   }
   
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java?rev=1209204&r1=1209203&r2=1209204&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
Thu Dec  1 19:37:00 2011
@@ -41,6 +41,10 @@ public class ReviewObject 
     public Builder(Map<String,Object> map) {
       super(map,ReviewObject.class,Builder.class);
     }
+    public Builder of(ASObject obj) {
+      set("of",obj);
+      return this;
+    }
     public Builder template() {
       return new Builder(map.build());
     }
@@ -53,4 +57,8 @@ public class ReviewObject 
   public <X extends ReviewObject, M extends ASObject.Builder<X,M>>ReviewObject(Map<String,Object>
map,Class<M> _class,Class<X>_obj) {
     super(map,_class,_obj);
   }
+  
+  public <X extends ASObject>X getOf() {
+    return this.<X>getProperty("of");
+  }
 }



Mime
View raw message