abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1202344 - in /abdera/abdera2: activities/src/main/java/org/apache/abdera2/activities/client/ activities/src/main/java/org/apache/abdera2/activities/model/ activities/src/main/java/org/apache/abdera2/activities/model/objects/ common/src/mai...
Date Tue, 15 Nov 2011 18:08:51 GMT
Author: jmsnell
Date: Tue Nov 15 18:08:50 2011
New Revision: 1202344

URL: http://svn.apache.org/viewvc?rev=1202344&view=rev
Log:
More basic api improvements, a couple of bug fixes

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/client/ActivitiesClientPusher.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AdditionalEventProperties.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CreativeWork.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EmbeddedExperience.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/MovieObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OfferObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Replies.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvEpisodeObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeasonObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeriesObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VersionObject.java
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/AbstractPusher.java
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/Pusher.java
    abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/PusherExample.java
    abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/RepliesAndTargetingExample.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/client/ActivitiesClientPusher.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/client/ActivitiesClientPusher.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/client/ActivitiesClientPusher.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/client/ActivitiesClientPusher.java Tue Nov 15 18:08:50 2011
@@ -26,6 +26,10 @@ import org.apache.abdera2.protocol.clien
 import org.apache.abdera2.protocol.client.RequestOptions;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableList;
+
 import static org.apache.abdera2.common.misc.MoreExecutors2.getExitingExecutor;
 
 /**
@@ -123,4 +127,25 @@ public class ActivitiesClientPusher<T ex
     resp.release();
   }
 
+  public void push(Supplier<? extends T> t) {
+    if (t == null) return;
+    T i = t.get();
+    if (i != null) push(i);
+  }
+
+  public void pushAll(T... t) {
+    if (t == null) return;
+    pushAll(ImmutableList.copyOf(t));
+  }
+
+  public void pushAll(Supplier<? extends T>... t) {
+    ImmutableList.Builder<T> list = ImmutableList.builder();
+    for (Supplier<? extends T> s : t) {
+      T i = s.get();
+      if (i != null)
+        list.add(i);
+    }
+    pushAll(list.build());
+  }
+
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java Tue Nov 15 18:08:50 2011
@@ -29,6 +29,7 @@ import java.util.Map.Entry;
 import org.apache.abdera2.activities.extra.Extra;
 import org.apache.abdera2.common.lang.Lang;
 import org.apache.abdera2.common.misc.ExceptionHelper;
+import org.apache.abdera2.common.misc.Pair;
 import org.apache.abdera2.common.selector.Selector;
 import org.apache.abdera2.common.selector.AbstractSelector;
 
@@ -36,6 +37,7 @@ import static org.apache.abdera2.common.
 import static com.google.common.base.Preconditions.*;
 
 import com.google.common.base.Function;
+import com.google.common.base.Optional;
 import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
@@ -99,8 +101,45 @@ public class ASBase 
       this.map.putAll(map);
     }
     public M set(String name, Object val) {
-      if (val != null)
-        map.put(name,val);
+      if (val != null) {
+        if (val instanceof Supplier)
+          val = ((Supplier<?>)val).get();
+        if (val instanceof Optional)
+          val = ((Optional<?>)val).get();
+        if (val != null)
+          map.put(name,val);
+      }
+      return (M)this;
+    }
+    public M set(Pair<String,? extends Object> pair) {
+      if (pair == null) return (M)this;
+      return set(pair.first(),pair.second());
+    }
+    public M set(Iterable<Pair<String,? extends Object>> pairs) {
+      if (pairs == null) return (M)this;
+      for (Pair<String,? extends Object> pair : pairs)
+        set(pair);
+      return (M)this;
+    }
+    public M set(Pair<String,? extends Object>... pairs) {
+      if (pairs == null) return (M)this;
+      for (Pair<String,? extends Object> pair : pairs)
+        set(pair);
+      return (M)this;
+    }
+    public M set(Map<String,? extends Object> map) {
+      if (map == null) return (M)this;
+      for (Map.Entry<String,? extends Object> entry : ImmutableMap.copyOf(map).entrySet())
+        set(entry);
+      return (M)this;
+    }
+    public M set(Map.Entry<String, ? extends Object> entry) {
+      if (entry == null) return (M)this;
+      return set(entry.getKey(),entry.getValue());
+    }
+    public M set(ASBase other) {
+      for (String field : other) 
+        set(field,other.getProperty(field));
       return (M)this;
     }
     public M lang(String lang) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java Tue Nov 15 18:08:50 2011
@@ -110,7 +110,7 @@ public class ASObject extends ASBase {
       super(map,_class,_builder);
     }
     
-    public M reaction(Supplier<TaskObject> object) {
+    public M reaction(Supplier<? extends TaskObject> object) {
       return reaction(object.get());
     }
     
@@ -121,9 +121,9 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M reaction(Supplier<TaskObject>... objects) {
+    public M reaction(Supplier<? extends TaskObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<TaskObject> object : objects)
+      for (Supplier<? extends TaskObject> object : objects)
         reaction(object.get());
       return (M)this;
     }
@@ -135,16 +135,16 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M reaction(Iterable<TaskObject> objects) {
+    public M reaction(Iterable<? extends TaskObject> objects) {
       if (objects == null) return (M)this;
       for (TaskObject obj : objects)
         reaction(obj);
       return (M)this;
     }
     
-    public M attachment(Supplier<ASObject>... objects) {
+    public M attachment(Supplier<? extends ASObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<ASObject> object : objects)
+      for (Supplier<? extends ASObject> object : objects)
         attachment(object.get());
       return (M)this;
     }
@@ -156,14 +156,14 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M attachment(Iterable<ASObject> objects) {
+    public M attachment(Iterable<? extends ASObject> objects) {
       if (objects == null) return (M)this;
       for (ASObject obj : objects)
         attachment(obj);
       return (M)this;
     }
     
-    public M attachment(Supplier<ASObject> object) {
+    public M attachment(Supplier<? extends ASObject> object) {
       return attachment(object.get());
     }
     
@@ -195,7 +195,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M inReplyTo(Supplier<ASObject> object) {
+    public M inReplyTo(Supplier<? extends ASObject> object) {
       return inReplyTo(object.get());
     }
     
@@ -206,9 +206,9 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M inReplyTo(Supplier<ASObject>... objects) {
+    public M inReplyTo(Supplier<? extends ASObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<ASObject> object : objects)
+      for (Supplier<? extends ASObject> object : objects)
         inReplyTo(object.get());
       return (M)this;
     }
@@ -227,9 +227,9 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M tag(Supplier<ASObject>... objects) {
+    public M tag(Supplier<? extends ASObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<ASObject>object : objects )
+      for (Supplier<? extends ASObject>object : objects )
         tag(object.get());
       return (M)this;
     }
@@ -241,14 +241,14 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M tag(Iterable<ASObject> objects) {
+    public M tag(Iterable<? extends ASObject> objects) {
       if (objects == null) return (M)this;
       for (ASObject obj : objects)
         tag(obj);
       return (M)this;
     }
     
-    public M tag(Supplier<ASObject> object) {
+    public M tag(Supplier<? extends ASObject> object) {
       return tag(object.get());
     }
     
@@ -280,7 +280,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M author(Supplier<ASObject> object) {
+    public M author(Supplier<? extends ASObject> object) {
       return author(object.get());
     }
     
@@ -299,7 +299,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M embed(Supplier<ASObject> object) {
+    public M embed(Supplier<? extends ASObject> object) {
       return embed(object.get());
     }
     
@@ -308,7 +308,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M embeddedExperience(Supplier<EmbeddedExperience> object) {
+    public M embeddedExperience(Supplier<? extends EmbeddedExperience> object) {
       return embeddedExperience(object.get());
     }
     
@@ -337,7 +337,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M location(Supplier<PlaceObject> object) {
+    public M location(Supplier<? extends PlaceObject> object) {
       return location(object.get());
     }
     
@@ -374,7 +374,7 @@ public class ASObject extends ASBase {
       return (M)this;
     }
     
-    public M source(Supplier<ASObject> object) {
+    public M source(Supplier<? extends ASObject> object) {
       return source(object.get());
     }
     

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java Tue Nov 15 18:08:50 2011
@@ -117,7 +117,7 @@ public class Activity extends ASObject {
       super(map,_class,_builder);
     }
     
-    public M to(Supplier<ASObject> object) {
+    public M to(Supplier<? extends ASObject> object) {
       return to(object.get());
     }
     public M to(ASObject object) {
@@ -125,7 +125,7 @@ public class Activity extends ASObject {
       to.add(object);
       return (M)this;
     }
-    public M cc(Supplier<ASObject> object) {
+    public M cc(Supplier<? extends ASObject> object) {
       return cc(object.get());
     }
     public M cc(ASObject object) {
@@ -133,7 +133,7 @@ public class Activity extends ASObject {
       cc.add(object);
       return (M)this;
     }
-    public M bcc(Supplier<ASObject> object) {
+    public M bcc(Supplier<? extends ASObject> object) {
       return bcc(object.get());
     }
     public M bcc(ASObject object) {
@@ -141,7 +141,7 @@ public class Activity extends ASObject {
       bcc.add(object);
       return (M)this;
     }
-    public M bto(Supplier<ASObject> object) {
+    public M bto(Supplier<? extends ASObject> object) {
       return bto(object.get());
     }
     public M bto(ASObject object) {
@@ -149,14 +149,14 @@ public class Activity extends ASObject {
       bto.add(object);
       return (M)this;
     }
-    public M actor(Supplier<ASObject> object) {
+    public M actor(Supplier<? extends ASObject> object) {
       return actor(object.get());
     }
     public M actor(ASObject object) {
       set(ACTOR,object);
       return (M)this;
     }
-    public M generator(Supplier<ASObject> object) {
+    public M generator(Supplier<? extends ASObject> object) {
       return generator(object.get());
     }
     public M generator(ASObject object) {
@@ -170,21 +170,21 @@ public class Activity extends ASObject {
       set(ICON,link);
       return (M)this;
     }
-    public M object(Supplier<ASObject> object) {
+    public M object(Supplier<? extends ASObject> object) {
       return object(object.get());
     }
     public M object(ASObject object) {
       set(OBJECT,object);
       return (M)this;
     }
-    public M provider(Supplier<ASObject> object) {
+    public M provider(Supplier<? extends ASObject> object) {
       return provider(object.get());
     }
     public M provider(ASObject object) {
       set(PROVIDER,object);
       return (M)this;
     }
-    public M target(Supplier<ASObject> object) {
+    public M target(Supplier<? extends ASObject> object) {
       return target(object.get());
     }
     public M target(ASObject object) {
@@ -210,7 +210,7 @@ public class Activity extends ASObject {
       icon(link);
       return (M)this;
     }
-    public M author(Supplier<ASObject> object) {
+    public M author(Supplier<? extends ASObject> object) {
       return author(object.get());
     }
     public M author(ASObject author) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java Tue Nov 15 18:08:50 2011
@@ -60,6 +60,10 @@ public class Collection<T extends ASObje
     return Collection.<T>makeCollection().items(items).get();
   }
   
+  public static <T extends ASObject>Collection<T> makeCollection(Supplier<? extends T>... items) {
+    return Collection.<T>makeCollection().items(items).get();
+  }
+  
   @SuppressWarnings("unchecked")
   static <T extends ASObject>Class<Collection<T>> _class(Class<?> _class) {
     return (Class<Collection<T>>) _class;
@@ -108,7 +112,7 @@ public class Collection<T extends ASObje
     public Builder(Map<String,Object> map,Class<X> _class, Class<M> _builder) {
       super(map,_class,_builder);
     }
-    public M item(Supplier<T> item) {
+    public M item(Supplier<? extends T> item) {
       return item(item.get());
     }
     public M item(T item) {
@@ -117,9 +121,9 @@ public class Collection<T extends ASObje
       items.add(item);
       return (M)this;
     } 
-    public M item(Supplier<T>... items) {
+    public M items(Supplier<? extends T>... items) {
       if (items == null) return (M)this;
-      for (Supplier<T> item : items)
+      for (Supplier<? extends T> item : items)
         item(item.get());
       return (M)this;
     }
@@ -129,7 +133,7 @@ public class Collection<T extends ASObje
         item(item);
       return (M)this;
     }
-    public M items(Iterable<T> items) {
+    public M items(Iterable<? extends T> items) {
       for (T item : items)
         item(item);
       return (M)this;

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java Tue Nov 15 18:08:50 2011
@@ -25,8 +25,8 @@ import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.abdera2.activities.io.gson.GsonIO;
 import org.apache.abdera2.common.anno.DefaultImplementation;
@@ -249,7 +249,7 @@ public abstract class IO {
     }
   }
   private static final Map<CacheKey,IO> map = 
-    new HashMap<CacheKey,IO>();
+    new ConcurrentHashMap<CacheKey,IO>();
   
   private static synchronized IO get_cached(TypeAdapter<?>... adapters) {
     return map.get(new CacheKey(adapters));

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AdditionalEventProperties.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AdditionalEventProperties.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AdditionalEventProperties.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AdditionalEventProperties.java Tue Nov 15 18:08:50 2011
@@ -48,11 +48,11 @@ public interface AdditionalEventProperti
     Builder superEvent(ASObject superEvent);
     Builder performers(ASObject performers);
     
-    Builder host(Supplier<ASObject> host);
-    Builder offers(Supplier<ASObject> offers);
-    Builder subEvents(Supplier<ASObject> subEvents);
-    Builder superEvent(Supplier<ASObject> superEvent);
-    Builder performers(Supplier<ASObject> performers);
+    Builder host(Supplier<? extends ASObject> host);
+    Builder offers(Supplier<? extends ASObject> offers);
+    Builder subEvents(Supplier<? extends ASObject> subEvents);
+    Builder superEvent(Supplier<? extends ASObject> superEvent);
+    Builder performers(Supplier<? extends ASObject> performers);
   }
   
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java Tue Nov 15 18:08:50 2011
@@ -23,6 +23,8 @@ import org.apache.abdera2.activities.mod
 import org.apache.abdera2.activities.model.MediaLink;
 import org.apache.abdera2.common.anno.Name;
 
+import com.google.common.base.Supplier;
+
 public class AudioObject 
   extends ASObject {
 
@@ -78,6 +80,9 @@ public class AudioObject 
       set(EMBEDCODE,code);
       return (M)this;
     }
+    public M stream(Supplier<MediaLink> stream) {
+      return stream(stream.get());
+    }
     public M stream(MediaLink stream) {
       set(STREAM,stream);
       return (M)this;

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookObject.java Tue Nov 15 18:08:50 2011
@@ -96,14 +96,14 @@ public class BookObject extends Creative
       set("edition",val);
       return (M)this;
     }
-    public M format(Supplier<ASObject> obj) {
+    public M format(Supplier<? extends ASObject> obj) {
       return format(obj.get());
     }
     public M format(ASObject obj) {
       set("format",obj);
       return (M)this;
     }
-    public M illustrator(Supplier<ASObject> obj) {
+    public M illustrator(Supplier<? extends ASObject> obj) {
       return illustrator(obj.get());
     }
     public M illustrator(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CreativeWork.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CreativeWork.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CreativeWork.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CreativeWork.java Tue Nov 15 18:08:50 2011
@@ -69,42 +69,42 @@ public abstract class CreativeWork exten
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M about(Supplier<ASObject> obj) {
+    public M about(Supplier<? extends ASObject> obj) {
       return about(obj.get());
     }
     public M about(ASObject object) {
       set("about",object);
       return (M)this;
     }
-    public M contributor(Supplier<ASObject> obj) {
+    public M contributor(Supplier<? extends ASObject> obj) {
       return contributor(obj.get());
     }
     public M contributor(ASObject object) {
       set("contributor",object);
       return (M)this;
     }
-    public M editor(Supplier<ASObject> obj) {
+    public M editor(Supplier<? extends ASObject> obj) {
       return editor(obj.get());
     }
     public M editor(ASObject object) {
       set("editor",object);
       return (M)this;
     }
-    public M genre(Supplier<ASObject> obj) {
+    public M genre(Supplier<? extends ASObject> obj) {
       return genre(obj.get());
     }
     public M genre(ASObject object) {
       set("genre",object);
       return (M)this;
     }
-    public M provider(Supplier<ASObject> obj) {
+    public M provider(Supplier<? extends ASObject> obj) {
       return provider(obj.get());
     }
     public M provider(ASObject object) {
       set("provider",object);
       return (M)this;
     }
-    public M publisher(Supplier<ASObject> obj) {
+    public M publisher(Supplier<? extends ASObject> obj) {
       return publisher(obj.get());
     }
     public M publisher(ASObject object) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EmbeddedExperience.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EmbeddedExperience.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EmbeddedExperience.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EmbeddedExperience.java Tue Nov 15 18:08:50 2011
@@ -160,7 +160,7 @@ public final class EmbeddedExperience 
       super(map,EmbeddedExperience.class,Builder.class);
     }
 
-    public Builder context(Supplier<ASBase> object) {
+    public Builder context(Supplier<? extends ASBase> object) {
       return context(object.get());
     }
     

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java Tue Nov 15 18:08:50 2011
@@ -104,7 +104,7 @@ public class EventObject 
       super(map,_class,_builder);
     }
     
-    public <T extends ASObject>M attending(Supplier<Collection<T>> col) {
+    public <T extends ASObject>M attending(Supplier<? extends Collection<T>> col) {
       return attending(col.get());
     }
 
@@ -118,7 +118,7 @@ public class EventObject 
       return (M)this;
     }
     
-    public <T extends ASObject>M maybeAttending(Supplier<Collection<T>> col) {
+    public <T extends ASObject>M maybeAttending(Supplier<? extends Collection<T>> col) {
       return maybeAttending(col.get());
     }
     
@@ -127,7 +127,7 @@ public class EventObject 
       return (M)this;
     }
     
-    public <T extends ASObject>M notAttending(Supplier<Collection<T>> col) {
+    public <T extends ASObject>M notAttending(Supplier<? extends Collection<T>> col) {
       return notAttending(col.get());
     }
     

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/MovieObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/MovieObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/MovieObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/MovieObject.java Tue Nov 15 18:08:50 2011
@@ -108,14 +108,14 @@ public class MovieObject extends Creativ
     public Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M actors(Supplier<ASObject> obj) {
+    public M actors(Supplier<? extends ASObject> obj) {
       return actors(obj.get());
     }
     public M actors(ASObject obj) {
       set("actors",obj);
       return (M)this;
     }
-    public M director(Supplier<ASObject> obj) {
+    public M director(Supplier<? extends ASObject> obj) {
       return director(obj.get());
     }
     public M director(ASObject obj) {
@@ -126,7 +126,7 @@ public class MovieObject extends Creativ
       set("duration",obj);
       return (M)this;
     }
-    public M musicBy(Supplier<ASObject> obj) {
+    public M musicBy(Supplier<? extends ASObject> obj) {
       return musicBy(obj.get());
     }
     public M musicBy(ASObject obj) {
@@ -140,14 +140,14 @@ public class MovieObject extends Creativ
       set("preview",obj);
       return (M)this;
     }
-    public M producer(Supplier<ASObject> obj) {
+    public M producer(Supplier<? extends ASObject> obj) {
       return producer(obj.get());
     }
     public M producer(ASObject obj) {
       set("producer",obj);
       return (M)this;
     }
-    public M productionCompany(Supplier<ASObject> obj) {
+    public M productionCompany(Supplier<? extends ASObject> obj) {
       return productionCompany(obj.get());
     }
     public M productionCompany(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OfferObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OfferObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OfferObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OfferObject.java Tue Nov 15 18:08:50 2011
@@ -111,14 +111,14 @@ public class OfferObject extends ASObjec
     public Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M availability(Supplier<ASObject> obj) {
+    public M availability(Supplier<? extends ASObject> obj) {
       return availability(obj.get());
     }
     public M availability(ASObject obj) {
       set("availability",obj);
       return (M)this;
     }
-    public M condition(Supplier<ASObject> obj) {
+    public M condition(Supplier<? extends ASObject> obj) {
       return condition(obj.get());
     }
     public M condition(ASObject obj) {
@@ -129,7 +129,7 @@ public class OfferObject extends ASObjec
       set("currency",obj);
       return (M)this;
     }
-    public M item(Supplier<ASObject> obj) {
+    public M item(Supplier<? extends ASObject> obj) {
       return item(obj.get());
     }
     public M item(ASObject obj) {
@@ -140,7 +140,7 @@ public class OfferObject extends ASObjec
       set("price",obj);
       return (M)this;
     }
-    public M restriction(Supplier<ASObject> obj) {
+    public M restriction(Supplier<? extends ASObject> obj) {
       return restriction(obj.get());
     }
     public M restriction(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java Tue Nov 15 18:08:50 2011
@@ -125,7 +125,7 @@ public class OrganizationObject extends 
     public Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M address(Supplier<Address> obj) {
+    public M address(Supplier<? extends Address> obj) {
       return address(obj.get());
     }
     public M address(Address address) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java Tue Nov 15 18:08:50 2011
@@ -174,7 +174,7 @@ public class PersonObject 
     public Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M account(Supplier<AccountObject> object) {
+    public M account(Supplier<? extends AccountObject> object) {
       return account(object.get());
     }
     public M account(AccountObject object) {
@@ -183,9 +183,9 @@ public class PersonObject 
       accounts.add(object);
       return (M)this;
     }
-    public M account(Supplier<AccountObject>... objects) {
+    public M account(Supplier<? extends AccountObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<AccountObject> object : objects)
+      for (Supplier<? extends AccountObject> object : objects)
         account(object.get());
       return (M)this;
     }
@@ -195,13 +195,13 @@ public class PersonObject 
         account(object);
       return (M)this;
     }
-    public M account(Iterable<AccountObject> objects) {
+    public M account(Iterable<? extends AccountObject> objects) {
       if (Iterables.isEmpty(objects)) return (M)this;
       for (AccountObject object : objects)
         account(object);
       return (M)this;
     }
-    public M address(Supplier<Address> object) {
+    public M address(Supplier<? extends Address> object) {
       return address(object.get());
     }
     public M address(Address object) {
@@ -210,9 +210,9 @@ public class PersonObject 
       addresses.add(object);
       return (M)this;
     }
-    public M address(Supplier<Address>... objects) {
+    public M address(Supplier<? extends Address>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<Address> object : objects)
+      for (Supplier<? extends Address> object : objects)
         address(object.get());
       return (M)this;
     }
@@ -222,13 +222,13 @@ public class PersonObject 
         address(object);
       return (M)this;
     }
-    public M address(Iterable<Address> objects) {
+    public M address(Iterable<? extends Address> objects) {
       if (Iterables.isEmpty(objects)) return (M)this;
       for (Address object : objects)
         address(object);
       return (M)this;
     }
-    public M alternateName(Supplier<NameObject> name) {
+    public M alternateName(Supplier<? extends NameObject> name) {
       return alternateName(name.get());
     }
     public M alternateName(NameObject name) {
@@ -237,9 +237,9 @@ public class PersonObject 
       altnames.add(name);
       return (M)this;
     }
-    public M alternateName(Supplier<NameObject>... objects) {
+    public M alternateName(Supplier<? extends NameObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<NameObject> object : objects)
+      for (Supplier<? extends NameObject> object : objects)
         alternateName(object.get());
       return (M)this;
     }
@@ -249,7 +249,7 @@ public class PersonObject 
         alternateName(object);
       return (M)this;
     }
-    public M alternateName(Iterable<NameObject> objects) {
+    public M alternateName(Iterable<? extends NameObject> objects) {
       if (Iterables.isEmpty(objects)) return (M)this;
       for (NameObject object : objects)
         alternateName(object);
@@ -291,7 +291,7 @@ public class PersonObject 
         im(object);
       return (M)this;
     }
-    public M organization(Supplier<OrganizationObject> object) {
+    public M organization(Supplier<? extends OrganizationObject> object) {
       return organization(object.get());
     }
     public M organization(OrganizationObject object) {
@@ -300,9 +300,9 @@ public class PersonObject 
       orgs.add(object);
       return (M)this;
     }
-    public M organization(Supplier<OrganizationObject>... objects) {
+    public M organization(Supplier<? extends OrganizationObject>... objects) {
       if (objects == null) return (M)this;
-      for (Supplier<OrganizationObject> object : objects)
+      for (Supplier<? extends OrganizationObject> object : objects)
         organization(object.get());
       return (M)this;
     }
@@ -312,7 +312,7 @@ public class PersonObject 
         organization(object);
       return (M)this;
     }
-    public M organization(Iterable<OrganizationObject> objects) {
+    public M organization(Iterable<? extends OrganizationObject> objects) {
       if (Iterables.isEmpty(objects)) return (M)this;
       for (OrganizationObject object : objects)
         organization(object);
@@ -376,21 +376,21 @@ public class PersonObject 
       set("dn",val);
       return (M)this;
     }
-    public M name(Supplier<NameObject> val) {
+    public M name(Supplier<? extends NameObject> val) {
       return name(val.get());
     }
     public M name(NameObject val) {
       set("name",val);
       return (M)this;
     }
-    public M nativeName(Supplier<NameObject> object) {
+    public M nativeName(Supplier<? extends NameObject> object) {
       return nativeName(object.get());
     }
     public M nativeName(NameObject val) {
       set("nativeName",val);
       return (M)this;
     }
-    public M preferredName(Supplier<NameObject> object) {
+    public M preferredName(Supplier<? extends NameObject> object) {
       return preferredName(object.get());
     }
     public M preferredName(NameObject val) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java Tue Nov 15 18:08:50 2011
@@ -76,6 +76,10 @@ public class PlaceObject 
     return makePlace().displayName(displayName).address(address).get();
   }
   
+  public static PlaceObject makePlace(String displayName, Supplier<? extends Address> address) {
+    return makePlace().displayName(displayName).address(address).get();
+  }
+  
   @Name("place")
   public static final class PlaceBuilder extends Builder<PlaceObject,PlaceBuilder> {
 
@@ -118,7 +122,7 @@ public class PlaceObject 
     public M position(Point point) {
       return position(IsoPosition.at(point));
     }
-    public M address(Supplier<Address> address) {
+    public M address(Supplier<? extends Address> address) {
       return address(address.get());
     }
     public M address(Address address) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java Tue Nov 15 18:08:50 2011
@@ -62,6 +62,18 @@ public class QuestionObject 
   public static QuestionObject makeQuestion(
     String displayName,
     String summary, 
+    Supplier<? extends ASObject> author,
+    Supplier<? extends ASObject>... options) {
+    return makeQuestion()
+      .displayName(displayName)
+      .summary(summary)
+      .author(author)
+      .option(options).get();
+  }
+  
+  public static QuestionObject makeQuestion(
+    String displayName,
+    String summary, 
     ASObject author,
     Iterable<ASObject> options) {
     return makeQuestion()
@@ -105,15 +117,15 @@ public class QuestionObject 
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M option(Iterable<ASObject> options) {
+    public M option(Iterable<? extends ASObject> options) {
       if (Iterables.isEmpty(options)) return (M)this;
       for (ASObject option : options)
         option(option);
       return (M)this;
     }
-    public M option(Supplier<ASObject>... options) {
+    public M option(Supplier<? extends ASObject>... options) {
       if (options == null) return (M)this;
-      for (Supplier<ASObject> option : options)
+      for (Supplier<? extends ASObject> option : options)
         option(option.get());
       return (M)this;
     }
@@ -123,7 +135,7 @@ public class QuestionObject 
         option(option);
       return (M)this;
     }
-    public M option(Supplier<ASObject> object) {
+    public M option(Supplier<? extends ASObject> object) {
       return option(object.get());
     }
     public M option(ASObject object) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Replies.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Replies.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Replies.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Replies.java Tue Nov 15 18:08:50 2011
@@ -49,20 +49,20 @@ public interface Replies extends Extensi
     <X extends ASObject>Builder saves(Collection<X> collection);
     <X extends ASObject>Builder shares(Collection<X> collection);
     
-    <X extends ASObject>Builder attending(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder followers(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder following(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder friends(Supplier<Collection<X>> collection);
+    <X extends ASObject>Builder attending(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder followers(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder following(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder friends(Supplier<? extends Collection<X>> collection);
     @Name("friend-requests") 
-    <X extends ASObject>Builder friendRequests(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder likes(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder notAttending(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder maybeAttending(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder members(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder replies(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder reviews(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder saves(Supplier<Collection<X>> collection);
-    <X extends ASObject>Builder shares(Supplier<Collection<X>> collection);
+    <X extends ASObject>Builder friendRequests(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder likes(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder notAttending(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder maybeAttending(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder members(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder replies(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder reviews(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder saves(Supplier<? extends Collection<X>> collection);
+    <X extends ASObject>Builder shares(Supplier<? extends Collection<X>> collection);
     
   }
   

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TaskObject.java Tue Nov 15 18:08:50 2011
@@ -98,14 +98,14 @@ public class TaskObject extends ASObject
     public Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M object(Supplier<ASObject> object) {
+    public M object(Supplier<? extends ASObject> object) {
       return object(object.get());
     }
     public M object(ASObject object) {
       set("for",object);
       return (M)this;
     }
-    public M actor(Supplier<ASObject> object) {
+    public M actor(Supplier<? extends ASObject> object) {
       return actor(object.get());
     }
     public M actor(ASObject object) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvEpisodeObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvEpisodeObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvEpisodeObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvEpisodeObject.java Tue Nov 15 18:08:50 2011
@@ -120,14 +120,14 @@ public class TvEpisodeObject extends Cre
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M actors(Supplier<ASObject> object) {
+    public M actors(Supplier<? extends ASObject> object) {
       return actors(object.get());
     }
     public M actors(ASObject obj) {
       set("actors",obj);
       return (M)this;
     }
-    public M director(Supplier<ASObject> object) {
+    public M director(Supplier<? extends ASObject> object) {
       return director(object.get());
     }
     public M director(ASObject obj) {
@@ -138,21 +138,21 @@ public class TvEpisodeObject extends Cre
       set("episodeNumber",n);
       return (M)this;
     }
-    public M season(Supplier<ASObject> object) {
+    public M season(Supplier<? extends ASObject> object) {
       return season(object.get());
     }
     public M season(ASObject obj) {
       set("season",obj);
       return (M)this;
     }
-    public M series(Supplier<ASObject> object) {
+    public M series(Supplier<? extends ASObject> object) {
       return series(object.get());
     }
     public M series(ASObject obj) {
       set("series",obj);
       return (M)this;
     }
-    public M musicBy(Supplier<ASObject> object) {
+    public M musicBy(Supplier<? extends ASObject> object) {
       return musicBy(object.get());
     }
     public M musicBy(ASObject obj) {
@@ -166,14 +166,14 @@ public class TvEpisodeObject extends Cre
       set("preview",obj);
       return (M)this;
     }
-    public M producer(Supplier<ASObject> object) {
+    public M producer(Supplier<? extends ASObject> object) {
       return producer(object.get());
     }
     public M producer(ASObject obj) {
       set("producer",obj);
       return (M)this;
     }
-    public M productionCompany(Supplier<ASObject> object) {
+    public M productionCompany(Supplier<? extends ASObject> object) {
       return productionCompany(object.get());
     }
     public M productionCompany(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeasonObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeasonObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeasonObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeasonObject.java Tue Nov 15 18:08:50 2011
@@ -124,14 +124,14 @@ public class TvSeasonObject extends Crea
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M actors(Supplier<ASObject> object) {
+    public M actors(Supplier<? extends ASObject> object) {
       return actors(object.get());
     }
     public M actors(ASObject obj) {
       set("actors",obj);
       return (M)this;
     }
-    public M director(Supplier<ASObject> object) {
+    public M director(Supplier<? extends ASObject> object) {
       return director(object.get());
     }
     public M director(ASObject obj) {
@@ -142,14 +142,14 @@ public class TvSeasonObject extends Crea
       set("seasonNumber",n);
       return (M)this;
     }
-    public M series(Supplier<ASObject> object) {
+    public M series(Supplier<? extends ASObject> object) {
       return series(object.get());
     }
     public M series(ASObject obj) {
       set("series",obj);
       return (M)this;
     }
-    public M musicBy(Supplier<ASObject> object) {
+    public M musicBy(Supplier<? extends ASObject> object) {
       return musicBy(object.get());
     }
     public M musicBy(ASObject obj) {
@@ -163,14 +163,14 @@ public class TvSeasonObject extends Crea
       set("preview",obj);
       return (M)this;
     }
-    public M producer(Supplier<ASObject> object) {
+    public M producer(Supplier<? extends ASObject> object) {
       return producer(object.get());
     }
     public M producer(ASObject obj) {
       set("producer",obj);
       return (M)this;
     }
-    public M productionCompany(Supplier<ASObject> object) {
+    public M productionCompany(Supplier<? extends ASObject> object) {
       return productionCompany(object.get());
     }
     public M productionCompany(ASObject obj) {
@@ -185,7 +185,7 @@ public class TvSeasonObject extends Crea
       set("endDate",dt);
       return (M)this;
     }
-    public M episodes(Supplier<ASObject> object) {
+    public M episodes(Supplier<? extends ASObject> object) {
       return episodes(object.get());
     }
     public M episodes(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeriesObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeriesObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeriesObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/TvSeriesObject.java Tue Nov 15 18:08:50 2011
@@ -121,21 +121,21 @@ public class TvSeriesObject extends Crea
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M actors(Supplier<ASObject> object) {
+    public M actors(Supplier<? extends ASObject> object) {
       return actors(object.get());
     }
     public M actors(ASObject obj) {
       set("actors",obj);
       return (M)this;
     }
-    public M director(Supplier<ASObject> object) {
+    public M director(Supplier<? extends ASObject> object) {
       return director(object.get());
     }
     public M director(ASObject obj) {
       set("director",obj);
       return (M)this;
     }
-    public M musicBy(Supplier<ASObject> object) {
+    public M musicBy(Supplier<? extends ASObject> object) {
       return musicBy(object.get());
     }
     public M musicBy(ASObject obj) {
@@ -149,28 +149,28 @@ public class TvSeriesObject extends Crea
       set("preview",obj);
       return (M)this;
     }
-    public M producer(Supplier<ASObject> object) {
+    public M producer(Supplier<? extends ASObject> object) {
       return producer(object.get());
     }
     public M producer(ASObject obj) {
       set("producer",obj);
       return (M)this;
     }
-    public M productionCompany(Supplier<ASObject> object) {
+    public M productionCompany(Supplier<? extends ASObject> object) {
       return productionCompany(object.get());
     }
     public M productionCompany(ASObject obj) {
       set("productionCompany",obj);
       return (M)this;
     }
-    public M episodes(Supplier<ASObject> object) {
+    public M episodes(Supplier<? extends ASObject> object) {
       return episodes(object.get());
     }
     public M episodes(ASObject obj) {
       set("episodes",obj);
       return (M)this;
     }
-    public M seasons(Supplier<ASObject> object) {
+    public M seasons(Supplier<? extends ASObject> object) {
       return seasons(object.get());
     }
     public M seasons(ASObject obj) {

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VersionObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VersionObject.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VersionObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VersionObject.java Tue Nov 15 18:08:50 2011
@@ -103,7 +103,7 @@ public class VersionObject 
     protected Builder(Map<String,Object> map,Class<X>_class,Class<M>_builder) {
       super(map,_class,_builder);
     }
-    public M active(Supplier<VersionObject> object) {
+    public M active(Supplier<? extends VersionObject> object) {
       return active(object.get());
     }
     public M active(VersionObject object) {
@@ -126,28 +126,28 @@ public class VersionObject 
       set("status",status.name().toLowerCase());
       return (M)this;
     }
-    public M next(Supplier<VersionObject> object) {
+    public M next(Supplier<? extends VersionObject> object) {
       return next(object.get());
     }
     public M next(VersionObject val) {
       set("nextVersion",val);
       return (M)this;
     }
-    public M of(Supplier<VersionObject> object) {
+    public M of(Supplier<? extends VersionObject> object) {
       return of(object.get());
     }
     public M of(ASObject val) {
       set("of",val);
       return (M)this;
     }
-    public M previous(Supplier<VersionObject> object) {
+    public M previous(Supplier<? extends VersionObject> object) {
       return previous(object.get());
     }
     public M previous(VersionObject val) {
       set("previousVersion",val);
       return (M)this;
     }
-    public M stable(Supplier<VersionObject> object) {
+    public M stable(Supplier<? extends VersionObject> object) {
       return stable(object.get());
     }
     public M stable(VersionObject val) {

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/AbstractPusher.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/AbstractPusher.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/AbstractPusher.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/AbstractPusher.java Tue Nov 15 18:08:50 2011
@@ -17,6 +17,8 @@
  */
 package org.apache.abdera2.common.pusher;
 
+import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
 public abstract class AbstractPusher<T> 
@@ -27,4 +29,25 @@ public abstract class AbstractPusher<T> 
       push(i);
   }
 
+  public void push(Supplier<? extends T> t) {
+    if (t == null) return;
+    T i = t.get();
+    if (i != null) 
+      push(i);
+  }
+  
+  public void pushAll(T... t) {
+    if (t == null) return;
+    pushAll(ImmutableList.copyOf(t));
+  }
+  
+  public void pushAll(Supplier<? extends T>... t) {
+    ImmutableList.Builder<T> list = ImmutableList.builder();
+    for (Supplier<? extends T> s : t) {
+      T i = s.get();
+      if (i != null)
+        list.add(i);
+    }
+    pushAll(list.build());
+  }
 }

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/Pusher.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/Pusher.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/Pusher.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/Pusher.java Tue Nov 15 18:08:50 2011
@@ -17,6 +17,8 @@
  */
 package org.apache.abdera2.common.pusher;
 
+import com.google.common.base.Supplier;
+
 /**
  * Used to push items into a channel. This will cause all registered
  * Listeners to receive notification of the item
@@ -24,6 +26,12 @@ package org.apache.abdera2.common.pusher
 public interface Pusher<T> {
 
   void push(T t);
+  
+  void push(Supplier<? extends T> t);
+  
+  void pushAll(T... t);
+  
+  void pushAll(Supplier<? extends T>... t);
 
   void pushAll(Iterable<T> t);
   

Modified: abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/PusherExample.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/PusherExample.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/PusherExample.java (original)
+++ abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/PusherExample.java Tue Nov 15 18:08:50 2011
@@ -6,12 +6,14 @@ import static org.apache.abdera2.activit
 import static org.apache.abdera2.activities.model.objects.PersonObject.makePerson;
 
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadPoolExecutor;
 
 import org.apache.abdera2.activities.model.Activity;
 import org.apache.abdera2.activities.model.Activity.ActivityBuilder;
 import org.apache.abdera2.activities.model.Verb;
+import static org.apache.abdera2.common.misc.MoreExecutors2.getExitingExecutor;
 import org.apache.abdera2.common.pusher.ChannelManager;
 import org.apache.abdera2.common.pusher.Pusher;
 import org.apache.abdera2.common.pusher.Receiver;
@@ -28,7 +30,7 @@ public class PusherExample {
   public static void main(String... args) throws Exception {
     
     final ChannelManager cm = new SimpleChannelManager();
-    ThreadPoolExecutor exec = (ThreadPoolExecutor) Executors.newCachedThreadPool();
+    ExecutorService exec = getExitingExecutor();
     final CountDownLatch latch = new CountDownLatch(3);
     exec.execute(
       new Runnable() {
@@ -52,14 +54,11 @@ public class PusherExample {
         gen.template()
           .set("object",
             makeNote()
-              .displayName(format("My note #%d",n+1))
-              .get())
-          .get()
+              .displayName(format("My note #%d",n+1)))
         );
     
     latch.await();
     cm.shutdown();
-    exec.shutdown();
     
   }
   

Modified: abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/RepliesAndTargetingExample.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/RepliesAndTargetingExample.java?rev=1202344&r1=1202343&r2=1202344&view=diff
==============================================================================
--- abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/RepliesAndTargetingExample.java (original)
+++ abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/RepliesAndTargetingExample.java Tue Nov 15 18:08:50 2011
@@ -13,14 +13,13 @@ public class RepliesAndTargetingExample 
     
     Activity activity = 
       Activity.makeActivity()
-        .to(makePerson().displayName("bob").get())
-        .cc(FRIENDS("Colleagues").get())
-        .bto(makePerson().displayName("sally").get())
+        .to(makePerson("bob"))
+        .cc(FRIENDS("Colleagues"))
+        .bto(makePerson("sally"))
         .bcc(NETWORK)
         .inReplyTo(
           makeNote()
-            .id("urn:foo:note:1")
-          .get())
+            .id("urn:foo:note:1"))
         .get();
     
     activity.writeTo(System.out);



Mime
View raw message