abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1201803 - in /abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities: extra/Extra.java model/objects/Objects.java
Date Mon, 14 Nov 2011 17:23:35 GMT
Author: jmsnell
Date: Mon Nov 14 17:23:35 2011
New Revision: 1201803

URL: http://svn.apache.org/viewvc?rev=1201803&view=rev
Log:
Adding @viewer and @owner to the list of special case objects

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Objects.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java?rev=1201803&r1=1201802&r2=1201803&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
(original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/Extra.java
Mon Nov 14 17:23:35 2011
@@ -314,6 +314,70 @@ public final class Extra {
     return audienceHasPublicOr(Audience.BTO, obj);
   }
   
+  public static Selector<Activity> isToOwner() {
+    return audienceHasOwner(Audience.TO);
+  }
+  
+  public static Selector<Activity> isToViewer() {
+    return audienceHasViewer(Audience.TO);
+  }
+  
+  public static Selector<Activity> isToOwnerOr(ASObject obj) {
+    return audienceHasOwnerOr(Audience.TO,obj);
+  }
+  
+  public static Selector<Activity> isToViewerOr(ASObject obj) {
+    return audienceHasViewerOr(Audience.TO,obj);
+  }
+  
+  public static Selector<Activity> isBtoOwner() {
+    return audienceHasOwner(Audience.BTO);
+  }
+  
+  public static Selector<Activity> isBtoViewer() {
+    return audienceHasViewer(Audience.BTO);
+  }
+  
+  public static Selector<Activity> isBtoOwnerOr(ASObject obj) {
+    return audienceHasOwnerOr(Audience.BTO,obj);
+  }
+  
+  public static Selector<Activity> isBtoViewerOr(ASObject obj) {
+    return audienceHasViewerOr(Audience.BTO,obj);
+  }
+  
+  public static Selector<Activity> isCcOwner() {
+    return audienceHasOwner(Audience.CC);
+  }
+  
+  public static Selector<Activity> isCcViewer() {
+    return audienceHasViewer(Audience.CC);
+  }
+  
+  public static Selector<Activity> isCcOwnerOr(ASObject obj) {
+    return audienceHasOwnerOr(Audience.CC,obj);
+  }
+  
+  public static Selector<Activity> isCcViewerOr(ASObject obj) {
+    return audienceHasViewerOr(Audience.CC,obj);
+  }
+
+  public static Selector<Activity> isBccOwner() {
+    return audienceHasOwner(Audience.BCC);
+  }
+  
+  public static Selector<Activity> isBccViewer() {
+    return audienceHasViewer(Audience.BCC);
+  }
+  
+  public static Selector<Activity> isBccOwnerOr(ASObject obj) {
+    return audienceHasOwnerOr(Audience.BCC,obj);
+  }
+  
+  public static Selector<Activity> isBccViewerOr(ASObject obj) {
+    return audienceHasViewerOr(Audience.BCC,obj);
+  }
+  
   public static Selector<Activity> isToMe() {
     return audienceHasMe(Audience.TO);
   }
@@ -370,6 +434,22 @@ public final class Extra {
     return audienceHasPublicOr(Audience.TO, obj);
   }
   
+  public static Selector<Activity> actorIsViewer() {
+    return actorIs(Extra.<Activity>isViewer());
+  }
+  
+  public static Selector<Activity> actorIsViewerOr(ASObject object) {
+    return actorIs(Extra.<Activity>isViewerOr(object));
+  }
+  
+  public static Selector<Activity> actorIsOwner() {
+    return actorIs(Extra.<Activity>isOwner());
+  }
+  
+  public static Selector<Activity> actorIsOwnerOr(ASObject object) {
+    return actorIs(Extra.<Activity>isOwnerOr(object));
+  }
+  
   public static Selector<Activity> actorIsMe() {
     return actorIs(Extra.<Activity>isMe());
   }
@@ -434,6 +514,22 @@ public final class Extra {
             "getActor", 
             pred);
   }
+   
+  public static Selector<Activity> audienceHasViewer(Audience audience) {
+    return audienceHas(audience,isViewer());
+  }
+  
+  public static Selector<Activity> audienceHasOwner(Audience audience) {
+    return audienceHas(audience,isOwner());
+  }
+  
+  public static Selector<Activity> audienceHasViewerOr(Audience audience, ASObject
obj) {
+    return audienceHas(audience,isViewerOr(obj));
+  }
+  
+  public static Selector<Activity> audienceHasOwnerOr(Audience audience, ASObject obj)
{
+    return audienceHas(audience,isOwnerOr(obj));
+  }
   
   public static Selector<Activity> audienceHasMe(Audience audience) {
     return audienceHas(audience,isMe());
@@ -506,6 +602,14 @@ public final class Extra {
   }
   
   
+  public static <X extends ASObject>Selector<X> isOwner() {
+    return (Selector<X>)sameIdentity(OWNER);
+  }
+  
+  public static <X extends ASObject>Selector<X> isViewer() {
+    return (Selector<X>)sameIdentity(VIEWER);
+  }
+  
   public static <X extends ASObject>Selector<X> isMe() {
     return (Selector<X>)sameIdentity(ME);
   }
@@ -534,6 +638,18 @@ public final class Extra {
     return (Selector<X>)sameIdentity(PUBLIC);
   }
   
+  public static <X extends ASObject>Selector<X> isOwnerOr(ASObject object) {
+    Selector<X> s1 = sameIdentity(object);
+    Selector<X> s2 = sameIdentity(OWNER);
+    return Selectors.<X>or(s1,s2);
+  }
+  
+  public static <X extends ASObject>Selector<X> isViewerOr(ASObject object) {
+    Selector<X> s1 = sameIdentity(object);
+    Selector<X> s2 = sameIdentity(VIEWER);
+    return Selectors.<X>or(s1,s2);
+  }
+  
   public static <X extends ASObject>Selector<X> isMeOr(ASObject object) {
     Selector<X> s1 = sameIdentity(object);
     Selector<X> s2 = sameIdentity(ME);

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=1201803&r1=1201802&r2=1201803&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
Mon Nov 14 17:23:35 2011
@@ -34,6 +34,16 @@ public final class Objects {
   public static final ASObject NETWORK = NETWORK().get();
   public static final ASObject ALL = ALL().get();
   public static final ASObject PUBLIC = PUBLIC().get();
+  public static final ASObject VIEWER = VIEWER().get();
+  public static final ASObject OWNER = OWNER().get();
+  
+  public static ASObjectBuilder VIEWER() {
+    return ASObject.makeObject("@viewer");
+  }
+  
+  public static ASObjectBuilder OWNER() {
+    return ASObject.makeObject("@owner");
+  }
   
   public static ASObjectBuilder SELF() {
     return ASObject.makeObject("@self");



Mime
View raw message