Creating an object:
*
* import static com.ibm.common.activitystreams.Makers.object;
- *
+ *
* ASObject obj = object()
* .id("urn:example:object:1")
* .displayName("My Note")
@@ -102,38 +102,38 @@ public class ASObject
/**
* Builder for concrete ASObject instances
*/
- public static class Builder
+ public static class Builder
extends AbstractBuilder {
/**
- * Returns the built ASObject instance
- * @return ASObject
- * @see com.google.common.base.Supplier#get()
+ * Returns the built ASObject instance
+ * @return ASObject
+ * @see com.google.common.base.Supplier#get()
**/
public ASObject get() {
return new ASObject(this);
}
}
-
+
/**
* Verifies that the rating value is within the proper range
* @param d double
- * @return double
+ * @return double
**/
private static double checkRating(double d) {
checkArgument(floor(d) >= 1 && ceil(d) <= 5);
return d;
}
-
+
/**
* Verifies that the value is non-negative
* @param i int
- * @return int
+ * @return int
**/
private static int checkNotNegative(int i) {
checkArgument(i >= 0);
return i;
}
-
+
/**
* Method checkNotNegative.
* @param l long
@@ -143,7 +143,7 @@ private static long checkNotNegative(long l) {
checkArgument(l >= 0);
return l;
}
-
+
/**
* Abstract base builder for ASObject instances.
*/
@@ -151,83 +151,83 @@ public static abstract class AbstractBuilder
>
extends AbstractWritable.AbstractWritableBuilder
implements Supplier, Writable {
-
- private final Map map =
+
+ private final Map map =
newLinkedHashMap();
- private final ActionsValue.Builder actions =
+ private final ActionsValue.Builder actions =
Makers.actions();
-
+
/**
* Method _dt.
* @param key String
* @param dt DateTime
- * @return B
+ * @return B
**/
protected B _dt(String key, DateTime dt) {
return set(key, dt);
}
-
+
/**
* Method _dt.
* @param key String
* @param dt String
- * @return B
+ * @return B
**/
protected B _dt(String key, String dt) {
return _dt(key, DateTime.parse(dt));
}
-
+
/**
* Method _dtNow.
* @param key String
- * @return B
+ * @return B
**/
protected B _dtNow(String key) {
return _dt(key, DateTime.now(UTC));
}
-
+
/**
* Method _dtFromNow.
* @param key String
* @param duration Duration
- * @return B
+ * @return B
**/
protected B _dtFromNow(String key, ReadableDuration duration) {
return _dt(key, DateTime.now(UTC).plus(duration));
}
-
+
/**
* Method _dtFromNow.
* @param key String
* @param period ReadablePeriod
- * @return B
+ * @return B
**/
protected B _dtFromNow(String key, ReadablePeriod period) {
return _dt(key, DateTime.now(UTC).plus(period));
}
-
+
/**
* Method _dtFromNow.
* @param key String
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
protected B _dtFromNow(String key, long v, TimeUnit unit) {
return _dtFromNow(key, toDuration(v,unit));
}
-
+
/**
* Method _dtFrom.
* @param key String
* @param dt DateTime
* @param duration Duration
- * @return B
+ * @return B
**/
protected B _dtFrom(String key, DateTime dt, ReadableDuration duration) {
return _dt(key, dt.plus(duration));
}
-
+
/**
* Method _dtFrom.
* @param key String
@@ -238,36 +238,36 @@ protected B _dtFrom(String key, DateTime dt, ReadableDuration duration) {
protected B _dtFrom(String key, DateTime dt, ReadablePeriod period) {
return _dt(key, dt.plus(period));
}
-
+
/**
* Method _dtFrom.
* @param key String
* @param dt DateTime
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
protected B _dtFrom(String key, DateTime dt, long v, TimeUnit unit) {
return _dtFrom(key, dt, toDuration(v,unit));
}
-
+
/**
* Set the published timestamp
* @param dt DateTime
- * @return B
+ * @return B
**/
public B published(DateTime dt) {
return _dt("published", dt);
}
-
+
/**
* Set the published timestamp equal to the current time
- * @return B
+ * @return B
**/
public B publishedNow() {
return _dtNow("published");
}
-
+
/**
* Set the published timestamp as a given duration from the current time.
* For instance:
@@ -278,12 +278,12 @@ public B publishedNow() {
* .get();
*
* @param duration Duration
- * @return B
+ * @return B
**/
public B publishedFromNow(ReadableDuration duration) {
return _dtFromNow("published", duration);
}
-
+
/**
* Set the published timestamp as a given period of time from the current time
*
@@ -293,39 +293,39 @@ public B publishedFromNow(ReadableDuration duration) {
* .get();
*
* @param period ReadablePeriod
- * @return B
+ * @return B
**/
public B publishedFromNow(ReadablePeriod period) {
return _dtFromNow("published", period);
}
-
+
/**
* Set the published timestamp as a given period of time from the current time
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
public B publishedFromNow(long v, TimeUnit unit) {
return _dtFromNow("published", v, unit);
}
-
+
/**
* Set the updated timestamp
* @param dt DateTime
- * @return B
+ * @return B
**/
public B updated(DateTime dt) {
return _dt("updated", dt);
}
-
+
/**
* Set the updated timestamp equal to the current time
- * @return B
+ * @return B
**/
public B updatedNow() {
return _dtNow("updated");
}
-
+
/**
* Set the updated timestamp as a given duration from the current time.
* For instance:
@@ -341,7 +341,7 @@ public B updatedNow() {
public B updatedFromNow(ReadableDuration duration) {
return _dtFromNow("updated", duration);
}
-
+
/**
* Set the updated timestamp as a given period from the current time.
* For instance:
@@ -357,26 +357,26 @@ public B updatedFromNow(ReadableDuration duration) {
public B updatedFromNow(ReadablePeriod period) {
return _dtFromNow("updated", period);
}
-
+
/**
* Set the updated timestamp as a given period from the current time
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
public B updatedFromNow(long v, TimeUnit unit) {
return _dtFromNow("updated", v, unit);
}
-
+
/**
* Set the start time
* @param dt DateTime
- * @return B
+ * @return B
**/
public B startTime(DateTime dt) {
return _dt("startTime", dt);
}
-
+
/**
* Set the startTime timestamp as a given duration from the current time.
* For instance:
@@ -387,12 +387,12 @@ public B startTime(DateTime dt) {
* .get();
*
* @param duration Duration
- * @return B
+ * @return B
**/
public B startTimeFromNow(ReadableDuration duration) {
return _dtFromNow("startTime", duration);
}
-
+
/**
* Set the startTime timestamp as a given period from the current time.
* For instance:
@@ -403,30 +403,30 @@ public B startTimeFromNow(ReadableDuration duration) {
* .get();
*
* @param period ReadablePeriod
- * @return B
+ * @return B
**/
public B startTimeFromNow(ReadablePeriod period) {
return _dtFromNow("startTime", period);
}
-
+
/**
* Set the startTime timestamp as a given period from the current time.
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
public B startTimeFromNow(long v, TimeUnit unit) {
return _dtFromNow("startTime", v, unit);
}
-
+
/**
* Set the start time to the current time
- * @return B
+ * @return B
**/
public B startTimeNow() {
return _dtNow("startTime");
}
-
+
/**
* Set the end time
* @param dt DateTime
@@ -435,7 +435,7 @@ public B startTimeNow() {
public B endTime(DateTime dt) {
return _dt("endTime", dt);
}
-
+
/**
* Set the endTime timestamp as a given duration from the current time.
* For instance:
@@ -446,12 +446,12 @@ public B endTime(DateTime dt) {
* .get();
*
* @param duration Duration
- * @return B
+ * @return B
**/
public B endTimeFromNow(ReadableDuration duration) {
return _dtFromNow("endTime", duration);
}
-
+
/**
* Set the endTime timestamp as a given period from the current time.
* For instance:
@@ -467,56 +467,56 @@ public B endTimeFromNow(ReadableDuration duration) {
public B endTimeFromNow(ReadablePeriod period) {
return _dtFromNow("endTime", period);
}
-
+
/**
* Set the endTime timestamp as a given period from the current time
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
public B endTimeFromNow(long v, TimeUnit unit) {
return _dtFromNow("endTime", v, unit);
}
-
+
/**
- * Set the end time
+ * Set the end time
* @return B
**/
public B endTimeNow() {
return _dtNow("endTimeNow");
}
-
+
/**
* Set the rating as a value in the range 0.00-1.00;
* @param d double
- * @return B
- * @throws IllegalArgumentException if the value is not
- * within the proper range
+ * @return B
+ * @throws IllegalArgumentException if the value is not
+ * within the proper range
**/
public B rating(double d) {
return set("rating", checkRating(d));
}
-
+
/**
* Set the duration
* @param s int
- * @return B
- * @throws IllegalArgumentException if the value
- * is less than zero
+ * @return B
+ * @throws IllegalArgumentException if the value
+ * is less than zero
**/
public B duration(long s) {
return duration(standardSeconds(checkNotNegative(s)));
}
-
+
/**
* Set the duration as a Joda-Time Duration
* @param d Duration
- * @return B
+ * @return B
**/
public B duration(ReadableDuration d) {
return set("duration", d);
}
-
+
/**
* Set the duration as a Joda-Time Period
* @param period ReadablePeriod
@@ -525,17 +525,17 @@ public B duration(ReadableDuration d) {
public B duration(ReadablePeriod period) {
return duration(period.toPeriod().toStandardDuration());
}
-
+
/**
* Set the duration
* @param v long
* @param unit TimeUnit
- * @return B
+ * @return B
**/
public B duration(long v, TimeUnit unit) {
return duration(toDuration(v,unit));
}
-
+
/**
* Set the duration as a given period of time from the given reference
* @param p ReadablePeriod
@@ -545,7 +545,7 @@ public B duration(long v, TimeUnit unit) {
public B durationFrom(ReadablePeriod p, DateTime dt) {
return duration(p.toPeriod().toDurationFrom(dt));
}
-
+
/**
* Set the duration as a given period of time from the current time
* @param p ReadablePeriod
@@ -554,67 +554,67 @@ public B durationFrom(ReadablePeriod p, DateTime dt) {
public B durationFromNow(ReadablePeriod p) {
return duration(p.toPeriod().toDurationFrom(DateTime.now(UTC)));
}
-
+
/**
* Set the height of the object in terms of number of device-independent
* pixels.
* @param h int
- * @return B
+ * @return B
**/
public B height(int h) {
return set("height", checkNotNegative(h));
}
-
+
/**
* Set the width of the object in terms of number of device-independent
* pixels.
* @param h int
- * @return B
+ * @return B
**/
public B width(int h) {
return set("width", checkNotNegative(h));
}
-
+
/**
* Set the MIME Media Type of the object
* @param mt String
- * @return B
+ * @return B
**/
public B mediaType(String mt) {
return mediaType(parse(mt));
}
-
+
/**
* Set the MIME Media Type of the object
* @param mt com.google.common.net.MediaType
- * @return B
+ * @return B
**/
public B mediaType(MediaType mt) {
return set("mediaType", mt);
}
-
+
/**
* Set the link relation
* @param rel String
- * @return B
+ * @return B
**/
public B rel(String rel) {
return set("rel", rel);
}
-
+
/**
* An objects alias is an alternative to it's "id".
* @param iri String
- * @return B
+ * @return B
**/
public B alias(String iri) {
return set("alias", iri);
}
-
+
/**
* Add an attachment
* @param url String
- * @return B
+ * @return B
**/
public B attachments(String url, String... urls) {
if (url != null)
@@ -624,48 +624,48 @@ public B attachments(String url, String... urls) {
link("attachments", linkValue(u));
return (B)this;
}
-
+
/**
* Add an attachment.
* @param link LinkValue
- * @return B
+ * @return B
**/
public B attachments(LinkValue link, LinkValue... links) {
if (link != null)
link("attachments", link);
- if (links != null)
+ if (links != null)
for (LinkValue l : links)
link("attachments", l);
return (B)this;
}
-
+
/**
* Add an attachment
* @param link Supplier extends LinkValue>
- * @return B
+ * @return B
**/
public B attachments(Supplier extends LinkValue> link) {
return link("attachments", link.get());
}
-
+
/**
* Set the author
* @param url String
- * @return B
+ * @return B
**/
public B author(String url, String... urls) {
if (url != null)
link("author", linkValue(url));
- if (urls != null)
+ if (urls != null)
for (String u : urls)
link("author", linkValue(u));
return (B)this;
}
-
+
/**
* Set the author
* @param link LinkValue
- * @return B
+ * @return B
**/
public B author(LinkValue link, LinkValue... links) {
if (link != null)
@@ -675,11 +675,11 @@ public B author(LinkValue link, LinkValue... links) {
link("author", l);
return (B)this;
}
-
+
/**
* Set the author
* @param link Supplier extends LinkValue>
- * @return B
+ * @return B
**/
public B author(Supplier extends LinkValue> link) {
return link("author", link.get());
@@ -688,7 +688,7 @@ public B author(Supplier extends LinkValue> link) {
/**
* Add a duplicate
* @param url String
- * @return B
+ * @return B
**/
public B duplicates(String url, String... urls) {
if (url != null)
@@ -698,11 +698,11 @@ public B duplicates(String url, String... urls) {
link("duplicates", linkValue(u));
return (B)this;
}
-
+
/**
* Add a duplicate
* @param link LinkValue
- * @return B
+ * @return B
**/
public B duplicates(LinkValue link, LinkValue... links) {
if (link != null)
@@ -712,11 +712,11 @@ public B duplicates(LinkValue link, LinkValue... links) {
link("duplicates", l);
return (B)this;
}
-
+
/**
* Add a duplicate
* @param link Supplier extends LinkValue>
- * @return B
+ * @return B
**/
public B duplicates(Supplier extends LinkValue> link) {
return link("duplicates", link.get());
@@ -735,7 +735,7 @@ public B icon(String url, String... urls) {
link("icon", linkValue(u));
return (B)this;
}
-
+
/**
* Set the icon
* @param link LinkValue
@@ -748,7 +748,7 @@ public B icon(LinkValue link, LinkValue... links) {
link("icon", l);
return (B)this;
}
-
+
/**
* Set the icon
* @param link Supplier extends LinkValue>
@@ -759,7 +759,7 @@ public B icon(Supplier extends LinkValue> link) {
/**
* Set the image
- * @param url String
+ * @param url String
* @return B */
public B image(String url, String... urls) {
if (url != null)
@@ -769,10 +769,10 @@ public B image(String url, String... urls) {
link("image", linkValue(u));
return (B)this;
}
-
+
/**
* Set the image.
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B image(LinkValue link, LinkValue... links) {
if (link != null)
@@ -782,15 +782,15 @@ public B image(LinkValue link, LinkValue... links) {
link("image", l);
return (B)this;
}
-
+
/**
* Set the image
- * @param link Supplier extends LinkValue>
+ * @param link Supplier extends LinkValue>
* @return B */
public B image(Supplier extends LinkValue> link) {
return link("image", link.get());
}
-
+
/**
* Set the location
* @param url String
@@ -803,10 +803,10 @@ public B location(String url, String... urls) {
link("location", linkValue(u));
return (B)this;
}
-
+
/**
* Set the location
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B location(LinkValue link, LinkValue... links) {
if (link != null)
@@ -816,18 +816,18 @@ public B location(LinkValue link, LinkValue... links) {
link("location", u);
return (B)this;
}
-
+
/**
* Set the location
- * @param link Supplier extends LinkValue>
+ * @param link Supplier extends LinkValue>
* @return B */
public B location(Supplier extends LinkValue> link) {
return link("location", link.get());
}
-
+
/**
* Set the generator
- * @param url String
+ * @param url String
* @return B */
public B generator(String url, String... urls) {
if (url != null)
@@ -837,10 +837,10 @@ public B generator(String url, String... urls) {
link("generator", linkValue(u));
return (B)this;
}
-
+
/**
* Set the generator
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B generator(LinkValue link, LinkValue... links) {
if (link != null)
@@ -850,18 +850,18 @@ public B generator(LinkValue link, LinkValue... links) {
link("generator", u);
return (B)this;
}
-
+
/**
* Set the generator.
- * @param link Supplier extends LinkValue>
+ * @param link Supplier extends LinkValue>
* @return B */
public B generator(Supplier extends LinkValue> link) {
return link("generator", link.get());
}
-
+
/**
* Set the provider
- * @param url String
+ * @param url String
* @return B */
public B provider(String url, String... urls) {
if (url != null)
@@ -871,10 +871,10 @@ public B provider(String url, String... urls) {
link("provider", linkValue(u));
return (B)this;
}
-
+
/**
* Set the provider
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B provider(LinkValue link, LinkValue... links) {
if (link != null)
@@ -884,18 +884,18 @@ public B provider(LinkValue link, LinkValue... links) {
link("provider",l);
return (B)this;
}
-
+
/**
* Set the provider
- * @param link Supplier extends LinkValue>
+ * @param link Supplier extends LinkValue>
* @return B */
public B provider(Supplier extends LinkValue> link) {
return link("provider", link.get());
}
-
+
/**
* Add a tag
- * @param url String
+ * @param url String
* @return B */
public B tags(String url, String... urls) {
if (url != null)
@@ -905,10 +905,10 @@ public B tags(String url, String... urls) {
link("tags", linkValue(u));
return (B)this;
}
-
+
/**
* Add a tag
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B tags(LinkValue link, LinkValue... links) {
if (link != null)
@@ -918,10 +918,10 @@ public B tags(LinkValue link, LinkValue... links) {
link("tags", l);
return (B)this;
}
-
+
/**
* Add a tag
- * @param link Supplier extends LinkValue>
+ * @param link Supplier extends LinkValue>
* @return B */
public B tags(Supplier extends LinkValue> link) {
return link("tags", link.get());
@@ -929,8 +929,8 @@ public B tags(Supplier extends LinkValue> link) {
/**
* Add in-reply-to
- * @param url String
- * @return B
+ * @param url String
+ * @return B
**/
public B inReplyTo(String url, String... urls) {
if (url != null)
@@ -940,10 +940,10 @@ public B inReplyTo(String url, String... urls) {
link("inReplyTo", linkValue(u));
return (B)this;
}
-
+
/**
* Add in-reply-to
- * @param link LinkValue
+ * @param link LinkValue
* @return B */
public B inReplyTo(LinkValue link, LinkValue... links) {
if (link != null)
@@ -953,24 +953,24 @@ public B inReplyTo(LinkValue link, LinkValue... links) {
link("inReplyTo", l);
return (B)this;
}
-
+
/**
* Add in-reply-to
- * @param link Supplier extends LinkValue>
- * @return B
+ * @param link Supplier extends LinkValue>
+ * @return B
**/
public B inReplyTo(Supplier extends LinkValue> link) {
return link("inReplyTo", link.get());
}
-
+
/**
* Add a replies collection
- * @param collection Collection
+ * @param collection Collection
* @return B */
public B replies(Collection collection) {
return set("replies", collection);
}
-
+
/**
* Add a replies collection
* @param collection Supplier extends Collection>
@@ -978,93 +978,93 @@ public B replies(Collection collection) {
public B replies(Supplier extends Collection> collection) {
return set("replies", collection.get());
}
-
+
/**
* Set the ID
* @param iri String
- * @return B
+ * @return B
**/
public B id(String iri) {
return set("id", iri);
}
-
+
/**
* Set the objectType
* @param iri String
- * @return B
+ * @return B
**/
public B objectType(String iri) {
return set("objectType", type(iri));
}
-
+
/**
* Set the objectType
* @param tv TypeValue
- * @return B
+ * @return B
**/
public B objectType(TypeValue tv) {
return set("objectType", tv);
}
-
+
/**
* Set the objectType
* @param tv Supplier extends TypeValue>
- * @return B
+ * @return B
**/
public B objectType(Supplier extends TypeValue> tv) {
return objectType(tv.get());
}
-
+
/**
* Set the language
- * @param lang String
- * @return B
+ * @param lang String
+ * @return B
**/
public B language(String lang) {
return set("language", lang);
}
-
+
/**
* Set the displayName
- * @param name String
- * @return B
+ * @param name String
+ * @return B
**/
public B displayName(String name) {
return _nlv("displayName", name);
}
-
+
/**
* Set the displayName
- * @param nlv NLV
- * @return B
+ * @param nlv NLV
+ * @return B
**/
public B displayName(NLV nlv) {
return _nlv("displayName", nlv);
}
-
+
/**
* Set the displayName
- * @param nlv Supplier
- * @return B
+ * @param nlv Supplier
+ * @return B
**/
public B displayName(Supplier nlv) {
return _nlv("displayName", nlv);
}
-
+
/**
* Set the displayName
* @param lang String
- * @param name String
- * @return B
+ * @param name String
+ * @return B
**/
public B displayName(String lang, String name) {
return _nlv("displayName",lang, name);
}
-
+
/**
* Set the displayName
- * @param map Map
- * @return B
+ * @param map Map
+ * @return B
**/
public B displayName(Map map) {
return _nlv("displayName", map);
@@ -1072,45 +1072,45 @@ public B displayName(Map map) {
/**
* Set the content
- * @param name String
- * @return B
+ * @param name String
+ * @return B
**/
public B content(String name) {
return _nlv("content", name);
}
-
+
/**
* Set the content
- * @param nlv NLV
- * @return B
+ * @param nlv NLV
+ * @return B
**/
public B content(NLV nlv) {
return _nlv("content", nlv);
}
-
+
/**
* Set the content
* @param nlv Supplier
- * @return B
+ * @return B
**/
public B content(Supplier nlv) {
return _nlv("content", nlv);
}
-
+
/**
* Set the content
* @param lang String
* @param name String
- * @return B
+ * @return B
**/
public B content(String lang, String name) {
return _nlv("content",lang, name);
}
-
+
/**
* Set the content
* @param map Map
- * @return B
+ * @return B
**/
public B content(Map map) {
return _nlv("content", map);
@@ -1119,44 +1119,44 @@ public B content(Map map) {
/**
* Set the summary
* @param name String
- * @return B
+ * @return B
**/
public B summary(String name) {
return _nlv("summary", name);
}
-
+
/**
* Set the summary
* @param nlv NLV
- * @return B
+ * @return B
**/
public B summary(NLV nlv) {
return _nlv("summary", nlv);
}
-
+
/**
* Set the summary
* @param nlv Supplier
- * @return B
+ * @return B
**/
public B summary(Supplier nlv) {
return _nlv("summary", nlv);
}
-
+
/**
* Set the summary
* @param lang String
* @param name String
- * @return B
+ * @return B
**/
public B summary(String lang, String name) {
return _nlv("summary",lang, name);
}
-
+
/**
* Set the summary
* @param map Map
- * @return B
+ * @return B
**/
public B summary(Map map) {
return _nlv("summary", map);
@@ -1165,49 +1165,49 @@ public B summary(Map map) {
/**
* Set the title
* @param name String
- * @return B
+ * @return B
**/
public B title(String name) {
return _nlv("title", name);
}
-
+
/**
* Set the title
* @param nlv NLV
- * @return B
+ * @return B
**/
public B title(NLV nlv) {
return _nlv("title", nlv);
}
-
+
/**
* Set the title
* @param nlv Supplier
- * @return B
+ * @return B
**/
public B title(Supplier nlv) {
return _nlv("title", nlv);
}
-
+
/**
* Set the title
* @param lang String
* @param value String
- * @return B
+ * @return B
**/
public B title(String lang, String value) {
return _nlv("title",lang, value);
}
-
+
/**
* Set the title
* @param map Map
- * @return B
+ * @return B
**/
public B title(Map map) {
return _nlv("title", map);
}
-
+
/**
* Add an action handler
* @param verb String
@@ -1222,7 +1222,7 @@ public B action(String verb, String iri, String... iris) {
actions.set(verb, i);
return (B)this;
}
-
+
/**
* Add an action handler
* @param verb String
@@ -1237,7 +1237,7 @@ public B action(String verb, LinkValue lv, LinkValue... links) {
actions.set(verb, l);
return (B)this;
}
-
+
/**
* Add an action handler
* @param verb String
@@ -1247,7 +1247,7 @@ public B action(String verb, LinkValue lv, LinkValue... links) {
public B action(String verb, Supplier extends LinkValue> lv) {
return action(verb, lv.get());
}
-
+
/**
* Method _nlv.
* @param key String
@@ -1257,45 +1257,45 @@ public B action(String verb, Supplier extends LinkValue> lv) {
protected B _nlv(String key, String value) {
return set(key, nlv(value));
}
-
+
/**
* Method _nlv.
* @param key String
* @param nlv NLV
- * @return B
+ * @return B
**/
protected B _nlv(String key, NLV nlv) {
return set(key, nlv);
}
-
+
/**
* Method _nlv.
* @param key String
* @param nlv Supplier extends NLV>
- * @return B
+ * @return B
**/
protected B _nlv(String key, Supplier extends NLV> nlv) {
return set(key, nlv.get());
}
-
+
/**
* Method _nlv.
* @param key String
* @param map Map
- * @return B
+ * @return B
**/
protected B _nlv(String key, Map map) {
for (Map.Entry entry : map.entrySet())
_nlv(key,entry.getKey(),entry.getValue());
return (B)this;
}
-
+
/**
* Method _nlv.
* @param key String
* @param lang String
* @param value String
- * @return B
+ * @return B
**/
protected B _nlv(String key, String lang, String value) {
if (map.containsKey(key)) {
@@ -1307,7 +1307,7 @@ protected B _nlv(String key, String lang, String value) {
String l = (String) map.get("language");
if (l == null)
l = DEFAULT_LOCALE;
- NLV.MapNLV.Builder b =
+ NLV.MapNLV.Builder b =
Makers.nlv();
if (lang.equals(l))
b.set(lang, value);
@@ -1316,10 +1316,10 @@ protected B _nlv(String key, String lang, String value) {
.set(lang, value);
return set(key, b);
case OBJECT:
- return set(key,
+ return set(key,
Makers.nlv()
.from((NLV.MapNLV)obj, lang)
- .set(lang, value));
+ .set(lang, value));
default:
throw new IllegalArgumentException();
}
@@ -1328,14 +1328,14 @@ protected B _nlv(String key, String lang, String value) {
return (B)this;
}
}
- set(key, Makers.nlv().set(lang,value));
+ set(key, Makers.nlv().set(lang,value));
return (B)this;
}
-
+
/**
* Set the "url"
* @param url String
- * @return B
+ * @return B
**/
public B url(String url, String... urls) {
if (url != null)
@@ -1345,20 +1345,20 @@ public B url(String url, String... urls) {
link("url", linkValue(u));
return (B)this;
}
-
+
/**
* Set the "url"
* @param link Supplier
- * @return B
+ * @return B
**/
public B url(Supplier extends LinkValue> link) {
return url(link.get());
}
-
+
/**
* Set the "url"
* @param link LinkValue
- * @return B
+ * @return B
**/
public B url(LinkValue link, LinkValue... links) {
if (link != null)
@@ -1368,22 +1368,22 @@ public B url(LinkValue link, LinkValue... links) {
link("url", l);
return (B)this;
}
-
+
/**
* Add a link
* @param name String
* @param url String
- * @return B
+ * @return B
**/
public B link(String name, String url) {
return link(name, linkValue(url));
}
-
+
/**
* Add a link
* @param name String
- * @param link LinkValue
- * @return B
+ * @param link LinkValue
+ * @return B
**/
public B link(String name, LinkValue link) {
if (link == null)
@@ -1391,7 +1391,7 @@ public B link(String name, LinkValue link) {
Object obj = map.get(name);
if (link.valueType() != ValueType.ARRAY) {
if (obj instanceof LinkValue)
- link =
+ link =
((LinkValue) obj).valueType() == ValueType.ARRAY ?
linkValues()
.add((LinkValue.ArrayLinkValue)obj)
@@ -1404,12 +1404,12 @@ public B link(String name, LinkValue link) {
} else set(name, link);
return (B)this;
}
-
+
/**
* Add a link
* @param name String
* @param link Supplier extends LinkValue>
- * @return B
+ * @return B
**/
public B link(String name, Supplier extends LinkValue> link) {
return link(name,link.get());
@@ -1419,17 +1419,17 @@ public B link(String name, Supplier extends LinkValue> link) {
* Add a link
* @param name String
* @param links Object[]
- * @return B
+ * @return B
**/
protected B link(String name, Object... links) {
if (links == null) return (B)this;
- ArrayLinkValue.Builder b =
+ ArrayLinkValue.Builder b =
ArrayLinkValue.make();
for (Object obj : links)
_add(b, obj);
return link(name,b.get());
}
-
+
/**
* Method _add.
* @param builder ArrayLinkValue.Builder
@@ -1446,15 +1446,15 @@ else if (obj instanceof Supplier)
_add(builder,((Supplier>)obj).get());
else throw new IllegalArgumentException();
}
-
+
/**
* Set a property
* @param key String
* @param value V
- * @return B
+ * @return B
**/
public B set(String key, Object value) {
- if (value == null)
+ if (value == null)
return (B)this;
if (value instanceof Supplier)
map.put(key, ((Supplier>)value).get());
@@ -1462,42 +1462,44 @@ public B set(String key, Object value) {
map.put(key, value);
return (B)this;
}
-
+
/**
* Set a property
* @param key String
* @param value Supplier
- * @return B
+ * @return B
**/
public B set(String key, Supplier> value) {
try {
return value == null ?
(B)this : set(key,value.get());
} catch (Throwable t) {
- throw propagate(t);
+ throwIfUnchecked(t);
+ throw new RuntimeException(t);
}
}
-
+
/**
* Set a property from a given callable
* @param key String
* @param value Callable
- * @return B
+ * @return B
**/
public B set(String key, Callable> value) {
try {
return value == null ?
- (B)this :
+ (B)this :
set(key,value.call());
} catch (Throwable t) {
- throw propagate(t);
+ throwIfUnchecked(t);
+ throw new RuntimeException(t);
}
}
-
+
/**
* Set the scope
* @param url String
- * @return B
+ * @return B
**/
public B scope(String url, String... urls) {
if (url != null)
@@ -1507,11 +1509,11 @@ public B scope(String url, String... urls) {
link("scope", linkValue(u));
return (B)this;
}
-
+
/**
* Set the scope
* @param link LinkValue
- * @return B
+ * @return B
**/
public B scope(LinkValue link, LinkValue... links) {
if (link != null)
@@ -1521,20 +1523,20 @@ public B scope(LinkValue link, LinkValue... links) {
link("scope", l);
return (B)this;
}
-
+
/**
* Set the scope
* @param link Supplier extends LinkValue>
-
+
* @return B */
public B scope(Supplier extends LinkValue> link) {
return link("scope", link.get());
- }
+ }
}
-
+
protected final ImmutableMap map;
private transient int hash = 1;
-
+
/**
* Constructor for ASObject.
* @param builder ASObject.AbstractBuilder,?>
@@ -1545,26 +1547,26 @@ public ASObject(ASObject.AbstractBuilder,?> builder) {
builder.map.put("actions", builder.actions.get());
this.map = ImmutableMap.copyOf(builder.map);
}
-
+
/**
- * Returns true if the given property exists, does not
+ * Returns true if the given property exists, does not
* determine if the value is non-null
* @param key String
- * @return boolean
+ * @return boolean
**/
public boolean has(String key) {
return map.containsKey(key);
}
-
+
/**
* Return the value of the property if it exists, null otherwise
* @param key String
- * @return V
+ * @return V
**/
public V get(String key) {
return this._get(key).orNull();
}
-
+
/**
* Return the value of the property if it exists, casting to a DateTime
* object.
@@ -1574,10 +1576,10 @@ public V get(String key) {
public DateTime getDateTime(String key) {
return this.get(key,toDateTime,Optional.absent()).orNull();
}
-
+
/**
* Return the value of the property if it exists, converting the value
- * to the given Enum class.
+ * to the given Enum class.
* @param key String
* @param _enumClass Class
* @return E
@@ -1585,7 +1587,7 @@ public DateTime getDateTime(String key) {
public >E getEnum(String key, Class _enumClass) {
return getEnum(key, _enumClass, (E)null);
}
-
+
/**
* Method getEnum.
* @param key String
@@ -1599,7 +1601,7 @@ public >E getEnum(String key, Class _enumClass, E or) {
return or != null ?
op.or(or) : op.orNull();
}
-
+
/**
* Return the value of the property if it exists, casting to a String
* object.
@@ -1609,7 +1611,7 @@ public >E getEnum(String key, Class _enumClass, E or) {
public String getString(String key) {
return getString(key, null);
}
-
+
/**
* Method getDuration.
* @param key String
@@ -1618,7 +1620,7 @@ public String getString(String key) {
public Duration getDuration(String key) {
return this.get(key, toDuration, Optional.absent()).orNull();
}
-
+
/**
* Method getPeriod.
* @param key String
@@ -1627,7 +1629,7 @@ public Duration getDuration(String key) {
public Period getPeriod(String key) {
return this.get(key, toPeriod, Optional.absent()).orNull();
}
-
+
/**
* Method getInterval.
* @param key String
@@ -1636,10 +1638,10 @@ public Period getPeriod(String key) {
public Interval getInterval(String key) {
return this.get(key, toInterval, Optional.absent()).orNull();
}
-
+
/**
- * Return the value of the property as a string if it exists or defaultValue if
- * it does not.
+ * Return the value of the property as a string if it exists or defaultValue if
+ * it does not.
* @param key String
* @param defaultValue String
* @return String
@@ -1649,7 +1651,7 @@ public String getString(String key, String defaultValue) {
this._get(key).or(defaultValue) :
this._get(key).orNull();
}
-
+
/**
* Return the value of the property as an int if it exists or 0 if it does not.
* @param key String
@@ -1658,7 +1660,7 @@ public String getString(String key, String defaultValue) {
public int getInt(String key) {
return getInt(key, 0);
}
-
+
/**
* Return the value of the property as an int if it exists or defaultValue if
* it does not
@@ -1669,7 +1671,7 @@ public int getInt(String key) {
public int getInt(String key, int defaultValue) {
return get(key, toInt, Optional.absent()).or(defaultValue);
}
-
+
/**
* Return the value of the property as a long if it exists or 0 if it does not
* @param key String
@@ -1678,7 +1680,7 @@ public int getInt(String key, int defaultValue) {
public long getLong(String key) {
return getLong(key,0L);
}
-
+
/**
* Return the value of the property as a long if it exists or defaultValue if
* it does not
@@ -1689,7 +1691,7 @@ public long getLong(String key) {
public long getLong(String key, long defaultValue) {
return get(key, toLong, Optional.absent()).or(defaultValue);
}
-
+
/**
* Return the value of the property as a double if it exists, or 0.0 if it
* does not
@@ -1699,7 +1701,7 @@ public long getLong(String key, long defaultValue) {
public double getDouble(String key) {
return getDouble(key, 0.0);
}
-
+
/**
* Return the value of the property as a double if it exists or defaultValue
* if it does not
@@ -1710,9 +1712,9 @@ public double getDouble(String key) {
public double getDouble(String key, double defaultValue) {
return get(key, toDouble, Optional.absent()).or(defaultValue);
}
-
+
/**
- * Return the value of the property as a float if it exists or 0f if it
+ * Return the value of the property as a float if it exists or 0f if it
* does not
* @param key String
* @return float
@@ -1720,7 +1722,7 @@ public double getDouble(String key, double defaultValue) {
public float getFloat(String key) {
return getFloat(key, 0f);
}
-
+
/**
* Return the value of the property as a float if it exists or defaultValue
* if it does not
@@ -1731,9 +1733,9 @@ public float getFloat(String key) {
public float getFloat(String key, float defaultValue) {
return get(key, toFloat, Optional.absent()).or(defaultValue);
}
-
+
/**
- * Return the value of the property as a short if it exists or 0 if it
+ * Return the value of the property as a short if it exists or 0 if it
* does not
* @param key String
* @return short
@@ -1741,7 +1743,7 @@ public float getFloat(String key, float defaultValue) {
public short getShort(String key) {
return getShort(key,(short)0);
}
-
+
/**
* Return the value of the property as a short if it exists or defaultValue
* if it does not
@@ -1752,9 +1754,9 @@ public short getShort(String key) {
public short getShort(String key, short defaultValue) {
return get(key, toShort, Optional.absent()).or(defaultValue);
}
-
+
/**
- * return the value of the property as a boolean if it exists or false
+ * return the value of the property as a boolean if it exists or false
* if it does not
* @param key String
* @return boolean
@@ -1762,7 +1764,7 @@ public short getShort(String key, short defaultValue) {
public boolean getBoolean(String key) {
return getBoolean(key,false);
}
-
+
/**
* Return the value of the property as a boolean if it exists or defaultValue
* if it does not
@@ -1771,11 +1773,11 @@ public boolean getBoolean(String key) {
* @return boolean
*/
public boolean getBoolean(
- String key,
+ String key,
boolean defaultValue) {
return get(key, toBoolean, Optional.absent()).or(defaultValue);
}
-
+
/**
* Method _get.
* @param key String
@@ -1784,7 +1786,7 @@ public boolean getBoolean(
private Optional _get(String key) {
return Optional.fromNullable((V)map.get(key));
}
-
+
/**
* Method _get.
* @param key String
@@ -1794,29 +1796,29 @@ private Optional _get(String key) {
private Optional _get(String key, Function transform) {
return this._get(key).transform(transform);
}
-
+
/**
* Return the value if it exists or defaultValue if it does not
* @param key String
* @param defaultValue V
- * @return V
+ * @return V
**/
public V get(String key, V defaultValue) {
return defaultValue != null ?
this._get(key).or(defaultValue) :
this._get(key).orNull();
}
-
+
/**
* Returns the value of the property, transformed using the given function
* @param key String
* @param transform Function
- * @return V2
+ * @return V2
**/
public V2 get(String key, Function transform, V2 defaultValue) {
return this._get(key,transform).or(defaultValue);
}
-
+
/**
* Returns the value of the given property converted using the given converter
* @param key String
@@ -1826,14 +1828,14 @@ public V2 get(String key, Function transform, V2 defaultValue) {
public V2 get(String key, Converter converter) {
return this._get(key,converter).orNull();
}
-
+
/**
* Returns the value of the property if it exists or defaultValue if it
* does not
* @param key String
* @param def V2
* @param transform Function
- * @return V2
+ * @return V2
**/
public V2 get(String key, V2 def, Function transform) {
return this._get(key,transform).or(def);
@@ -1841,123 +1843,123 @@ public V2 get(String key, V2 def, Function transform) {
/**
* Returns an iterator listing all of the properties defined on this object
- * @return Iterator
- * @see java.lang.Iterable#iterator()
+ * @return Iterator
+ * @see java.lang.Iterable#iterator()
**/
public Iterator iterator() {
return map.keySet().iterator();
}
-
+
/**
* Return this objects identifier
- * @return String
- * @see com.ibm.common.activitystreams.TypeValue#id()
+ * @return String
+ * @see com.ibm.common.activitystreams.TypeValue#id()
**/
public String id() {
return this.getString("id");
}
-
+
/**
* Return the objectType
- * @return T
+ * @return T
**/
public T objectType() {
return this.get("objectType");
}
-
+
/**
* Return this object's type identifier as a string
- * @return String
+ * @return String
**/
public String objectTypeString() {
return typeValueAsString("objectType");
}
-
+
/**
* Method typeValueAsString.
* @param name String
- * @return String
+ * @return String
**/
protected String typeValueAsString(String name) {
TypeValue tv = this.get(name);
return tv != null ? tv.id() : null;
}
-
+
/**
* Return this object's language context
- * @return String
+ * @return String
**/
public String language() {
return this.getString("language");
}
-
+
/**
* Return this objects displayName as an NLV object
- * @return NLV
+ * @return NLV
**/
public NLV displayName() {
return this.get("displayName");
}
-
+
/**
* Return this objects displayName
- * @return String
+ * @return String
**/
public String displayNameString() {
return _nlv("displayName");
}
-
+
/**
* Method displayNameString.
* @param lang String
- * @return String
+ * @return String
**/
public String displayNameString(String lang) {
return _nlv("displayName", lang);
}
-
+
/**
* Method _nlv.
* @param key String
- * @return String
+ * @return String
**/
protected String _nlv(String key) {
String lang = language();
return _nlv(key, lang != null ? lang : DEFAULT_LOCALE);
}
-
+
/**
* Method _nlv.
* @param key String
* @param lang String
- * @return String
+ * @return String
**/
protected String _nlv(String key, String lang) {
- NLV nlv =
+ NLV nlv =
this.get(key);
switch(nlv.valueType()) {
case SIMPLE:
- NLV.SimpleNLV sim =
+ NLV.SimpleNLV sim =
(SimpleNLV) nlv;
String l = language();
return l == null || Objects.equal(l,lang) ? sim.value() : null;
case OBJECT:
- NLV.MapNLV map =
+ NLV.MapNLV map =
(MapNLV) nlv;
return map.value(lang);
default:
return null;
- }
+ }
}
-
+
/**
* Return this objects URL LinkValues
- * @return java.util.Iterable<LinkValue>
+ * @return java.util.Iterable<LinkValue>
**/
public Iterable url() {
return links("url");
}
-
+
/**
* Return the matching URL LinkValues
* @return java.util.Iterable<LinkValue>
@@ -1965,7 +1967,7 @@ public Iterable url() {
public Iterable url(Predicate super LinkValue> test) {
return links("url", test);
}
-
+
/**
* Return this objects first URL LinkValue
* @return LinkValue
@@ -1973,7 +1975,7 @@ public Iterable url(Predicate super LinkValue> test) {
public LinkValue firstUrl() {
return firstLink("url");
}
-
+
/**
* Return this objects first matching LinkValue
* @param test
@@ -1982,35 +1984,35 @@ public LinkValue firstUrl() {
public LinkValue firstMatchingUrl(Predicate super LinkValue> test) {
return firstMatchingLink("url", test);
}
-
+
/**
* Return this object's mediaType
- * @return MediaType
+ * @return MediaType
**/
public MediaType mediaType() {
return this.get("mediaType");
}
-
+
/**
* Returns the value of this objects's rel property
- * @return String
+ * @return String
**/
public String rel() {
return this.getString("rel");
}
-
+
/**
* Returns this value of this object's alias property
- * @return String
+ * @return String
**/
public String alias() {
return this.getString("alias");
}
-
+
/**
* Return the given set of links
* @param name String
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
protected Iterable links(String name) {
LinkValue lv = this.get(name);
@@ -2018,31 +2020,31 @@ protected Iterable links(String name) {
return lv.valueType() == ValueType.ARRAY ?
(Iterable)lv : of(lv);
}
-
+
protected Iterable links(
- String name,
+ String name,
Predicate super LinkValue> test) {
return filter(links(name), test);
}
-
+
protected LinkValue firstLink(String name) {
return getFirst(links(name), null);
}
-
+
protected LinkValue firstMatchingLink(
- String name,
+ String name,
Predicate super LinkValue> test) {
return getFirst(links(name,test), null);
}
-
+
/**
* Return the set of attachments
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable attachments() {
return links("attachments");
}
-
+
/**
* Return the matching set of attachments;
* @param test
@@ -2051,7 +2053,7 @@ public Iterable attachments() {
public Iterable attachments(Predicate super LinkValue> test) {
return links("attachments", test);
}
-
+
/**
* Return the first attachment for this object
* @return LinkValue
@@ -2059,7 +2061,7 @@ public Iterable attachments(Predicate super LinkValue> test) {
public LinkValue firstAttachment() {
return firstLink("attachments");
}
-
+
/**
* Return the first matching attachment
* @param test
@@ -2068,15 +2070,15 @@ public LinkValue firstAttachment() {
public LinkValue firstMatchingAttachment(Predicate super LinkValue> test) {
return firstMatchingLink("attachments", test);
}
-
+
/**
* Return this authors of this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable author() {
return links("author");
}
-
+
/**
* Return the matching authors of this object
* @return java.util.Iterable
@@ -2084,7 +2086,7 @@ public Iterable author() {
public Iterable author(Predicate super LinkValue> test) {
return links("author", test);
}
-
+
/**
* Return the first author
* @return LinkValue
@@ -2092,7 +2094,7 @@ public Iterable author(Predicate super LinkValue> test) {
public LinkValue firstAuthor() {
return firstLink("author");
}
-
+
/**
* Return the first matching author
* @param test
@@ -2101,15 +2103,15 @@ public LinkValue firstAuthor() {
public LinkValue firstMatchingAuthor(Predicate super LinkValue> test) {
return firstMatchingLink("author", test);
}
-
+
/**
* Return the collection of duplicates for this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable duplicates() {
return links("duplicates");
}
-
+
/**
* Return the matching duplicates
* @param test
@@ -2118,7 +2120,7 @@ public Iterable duplicates() {
public Iterable duplicates(Predicate super LinkValue> test) {
return links("duplicates", test);
}
-
+
/**
* Return the first duplicate
* @return LinkValue
@@ -2126,7 +2128,7 @@ public Iterable duplicates(Predicate super LinkValue> test) {
public LinkValue firstDuplicate() {
return firstLink("duplicates");
}
-
+
/**
* Return the first matching duplicate
* @param test
@@ -2135,14 +2137,14 @@ public LinkValue firstDuplicate() {
public LinkValue firstMatchingDuplicate(Predicate super LinkValue> test) {
return firstMatchingLink("duplicates", test);
}
-
+
/**
* Return the icons for this object
* @return java.util.Iterable */
public Iterable icon() {
return links("icon");
}
-
+
/**
* Return the matching icons for this object
* @return java.util.Iterable
@@ -2150,7 +2152,7 @@ public Iterable icon() {
public Iterable icon(Predicate super LinkValue> test) {
return links("icon", test);
}
-
+
/**
* Return the first icon
* @return LinkValue
@@ -2158,7 +2160,7 @@ public Iterable icon(Predicate super LinkValue> test) {
public LinkValue firstIcon() {
return firstLink("icon");
}
-
+
/**
* Return thie first matching icon
* @param test
@@ -2167,7 +2169,7 @@ public LinkValue firstIcon() {
public LinkValue firstMatchingIcon(Predicate super LinkValue> test) {
return firstMatchingLink("icon", test);
}
-
+
/**
* Return the image for this object
* @return java.util.Iterable
@@ -2175,7 +2177,7 @@ public LinkValue firstMatchingIcon(Predicate super LinkValue> test) {
public Iterable image() {
return links("image");
}
-
+
/**
* Return the matching images for this object
* @param test
@@ -2184,7 +2186,7 @@ public Iterable image() {
public Iterable image(Predicate super LinkValue> test) {
return links("image", test);
}
-
+
/**
* Return the first image
* @return LinkValue
@@ -2192,7 +2194,7 @@ public Iterable image(Predicate super LinkValue> test) {
public LinkValue firstImage() {
return firstLink("image");
}
-
+
/**
* Return the first matching image
* @param test
@@ -2201,15 +2203,15 @@ public LinkValue firstImage() {
public LinkValue firstMatchingImage(Predicate super LinkValue> test) {
return firstMatchingLink("image", test);
}
-
+
/**
* Return the location associated with this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable location() {
return links("location");
}
-
+
/**
* Return the matching locations associated with this object
* @param test
@@ -2218,7 +2220,7 @@ public Iterable location() {
public Iterable location(Predicate super LinkValue> test) {
return links("location", test);
}
-
+
/**
* Return the first location associated with this object
* @return LinkValue
@@ -2226,7 +2228,7 @@ public Iterable location(Predicate super LinkValue> test) {
public LinkValue firstLocation() {
return firstLink("location");
}
-
+
/**
* Return the first matching location associated with this object
* @param test
@@ -2235,15 +2237,15 @@ public LinkValue firstLocation() {
public LinkValue firstMatchingLocation(Predicate super LinkValue> test) {
return firstMatchingLink("location", test);
}
-
+
/**
* Return the generators for this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable generator() {
return links("generator");
}
-
+
/**
* Return the matching generators for this object
* @return java.util.Iterable
@@ -2251,7 +2253,7 @@ public Iterable generator() {
public Iterable generator(Predicate super LinkValue> test) {
return links("generator", test);
}
-
+
/**
* Return the first generator for this object
* @return LinkValue
@@ -2259,7 +2261,7 @@ public Iterable generator(Predicate super LinkValue> test) {
public LinkValue firstGenerator() {
return firstLink("generator");
}
-
+
/**
* Return the first matching generator for this object
* @param test
@@ -2268,15 +2270,15 @@ public LinkValue firstGenerator() {
public LinkValue firstMatchingGenerator(Predicate super LinkValue> test) {
return firstMatchingLink("generator", test);
}
-
+
/**
* Return the providers for this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable provider() {
return links("provider");
}
-
+
/**
* Return the matching providers for this object
* @return java.util.Iterable
@@ -2284,7 +2286,7 @@ public Iterable provider() {
public Iterable provider(Predicate super LinkValue> test) {
return links("provider", test);
}
-
+
/**
* Return the first provider for this object
* @return LinkValue
@@ -2292,7 +2294,7 @@ public Iterable provider(Predicate super LinkValue> test) {
public LinkValue firstProvider() {
return firstLink("provider");
}
-
+
/**
* Return the first matching providers for this object
* @param test
@@ -2301,15 +2303,15 @@ public LinkValue firstProvider() {
public LinkValue firstMatchingProvider(Predicate super LinkValue> test) {
return firstMatchingLink("provider", test);
}
-
+
/**
* Return the tags for this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable tags() {
return links("tags");
}
-
+
/**
* Return the matching tags for this object
* @return java.util.Iterable
@@ -2317,7 +2319,7 @@ public Iterable tags() {
public Iterable tags(Predicate super LinkValue> test) {
return links("tags", test);
}
-
+
/**
* Return the first tag for this object
* @return LinkValue
@@ -2325,7 +2327,7 @@ public Iterable tags(Predicate super LinkValue> test) {
public LinkValue firstTag() {
return firstLink("tags");
}
-
+
/**
* Return this first matching tag for this object
* @param test
@@ -2334,15 +2336,15 @@ public LinkValue firstTag() {
public LinkValue firstMatchingTag(Predicate super LinkValue> test) {
return firstMatchingLink("tags", test);
}
-
+
/**
* Return the inReplyTo links for this object
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable inReplyTo() {
return links("inReplyTo");
}
-
+
/**
* Return the matching inReplyTo links for this object
* @return java.util.Iterable
@@ -2350,7 +2352,7 @@ public Iterable inReplyTo() {
public Iterable inReplyTo(Predicate super LinkValue> test) {
return links("inReplyTo", test);
}
-
+
/**
* Return the first inReplyTo link for this object
* @return LinkValue
@@ -2358,7 +2360,7 @@ public Iterable inReplyTo(Predicate super LinkValue> test) {
public LinkValue firstInReplyTo() {
return firstLink("inReplyTo");
}
-
+
/**
* Return the first matching inReplyTo link for this object
* @param test
@@ -2367,23 +2369,23 @@ public LinkValue firstInReplyTo() {
public LinkValue firstMatchingInReplyTo(Predicate super LinkValue> test) {
return firstMatchingLink("inReplyTo", test);
}
-
+
/**
* Return the content of this object
- * @return NLV
+ * @return NLV
**/
public NLV content() {
return this.get("content");
}
-
+
/**
* Return the content of this object
- * @return String
+ * @return String
**/
public String contentString() {
return _nlv("content");
}
-
+
/**
* Return the content of this object for the given language
* @param lang String
@@ -2391,48 +2393,48 @@ public String contentString() {
public String contentString(String lang) {
return _nlv("content", lang);
}
-
+
/**
* Return the title of this object
- * @return NLV
+ * @return NLV
**/
public NLV title() {
return this.get("title");
}
-
+
/**
* Return the title of this object
- * @return String
+ * @return String
**/
public String titleString() {
return _nlv("title");
}
-
+
/**
* Return the title of this object for the given language
* @param lang String
- * @return String
+ * @return String
**/
public String titleString(String lang) {
return _nlv("title", lang);
}
-
+
/**
* Return the summary of this object
- * @return NLV
+ * @return NLV
**/
public NLV summary() {
return this.get("summary");
}
-
+
/**
* Return the summary of this object
- * @return String
+ * @return String
**/
public String summaryString() {
return _nlv("summary");
}
-
+
/**
* Return the summary of this object for the given language
* @param lang String
@@ -2440,93 +2442,93 @@ public String summaryString() {
public String summaryString(String lang) {
return _nlv("summary", lang);
}
-
+
/**
* Return the published timestamp for this object
* @return DateTime */
public DateTime published() {
return this.getDateTime("published");
}
-
+
/**
* Return the updated timestamp for this object
- * @return DateTime
+ * @return DateTime
**/
public DateTime updated() {
return this.getDateTime("updated");
}
-
+
/**
* Return the startTime timestamp for this object
- * @return DateTime
+ * @return DateTime
**/
public DateTime startTime() {
return this.getDateTime("startTime");
}
-
+
/**
* Return the endTime timestamp for this object
- * @return DateTime
+ * @return DateTime
**/
public DateTime endTime() {
return this.getDateTime("endTime");
}
-
+
/**
* Return the rating property for this object
- * @return double
+ * @return double
**/
public double rating() {
return checkRating(getDouble("rating"));
}
-
+
/**
* Return the duration of this object
- * @return Duration
+ * @return Duration
**/
public Duration duration() {
return this.get("duration", toDuration, Optional.absent()).orNull();
}
-
+
/**
* Return the height of this object in device independent pixels
- * @return int
+ * @return int
**/
public int height() {
return checkNotNegative(getInt("height"));
}
-
+
/**
* Return the width of this object in device independent pixels
- * @return int
+ * @return int
**/
public int width() {
return checkNotNegative(getInt("width"));
}
-
+
/**
* Return the replies collection for this object
* @return Collection */
public Collection replies() {
return this.get("replies");
}
-
+
/**
* Return the actions collection for this object
- * @return ActionsValue
+ * @return ActionsValue
*/
public ActionsValue actions() {
return this.get("actions");
}
-
+
/**
* Return the scope
- * @return java.util.Iterable
+ * @return java.util.Iterable
**/
public Iterable scope() {
return links("scope");
}
-
+
/**
* Return the matching scope items
* @return java.util.Iterable
@@ -2534,7 +2536,7 @@ public Iterable scope() {
public Iterable scope(Predicate super LinkValue> test) {
return links("scope", test);
}
-
+
/**
* Return the first scope item
* @return LinkValue
@@ -2542,7 +2544,7 @@ public Iterable scope(Predicate super LinkValue> test) {
public LinkValue firstScope() {
return firstLink("scope");
}
-
+
/**
* Return the first matching scope item
* @param test
@@ -2568,11 +2570,11 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return false;
ASObject other = (ASObject) obj;
- return
+ return
difference(map, other.map)
.areEqual();
}
-
+
/**
* Return the valueType of this object (always returns ValueType.OBJECT)
* @return ValueType
@@ -2581,15 +2583,15 @@ public boolean equals(Object obj) {
public ValueType valueType() {
return ValueType.OBJECT;
}
-
-
- // Java Serialization support...
-
+
+
+ // Java Serialization support...
+
Object writeReplace() throws java.io.ObjectStreamException {
return new SerializedForm(this);
}
-
- private static class SerializedForm
+
+ private static class SerializedForm
extends AbstractSerializedForm {
protected SerializedForm(ASObject obj) {
super(obj);
@@ -2602,16 +2604,16 @@ Object readResolve() throws ObjectStreamException {
return super.doReadResolve();
}
}
-
- protected static abstract class AbstractSerializedForm
+
+ protected static abstract class AbstractSerializedForm
implements Serializable {
private static final long serialVersionUID = -801787904013409277L;
private ImmutableMap map;
- protected AbstractSerializedForm(A obj) {
+ protected AbstractSerializedForm(A obj) {
this.map = ImmutableMap.copyOf(Maps.transformValues(obj.map, SerializableTransform));
}
protected abstract ASObject.AbstractBuilder, ?> builder();
- protected Object doReadResolve()
+ protected Object doReadResolve()
throws java.io.ObjectStreamException {
ASObject.AbstractBuilder,?> builder = builder();
for (Map.Entry entry : map.entrySet()) {
@@ -2623,8 +2625,8 @@ protected Object doReadResolve()
return builder.get();
}
}
-
- private static final Function