com.ning.api.client.json.ItemSequenceResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ning-api-java Show documentation
Show all versions of ning-api-java Show documentation
Java client library for accessing Ning external API
package com.ning.api.client.json;
import java.util.Collections;
import java.util.List;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* POJO used for data binding responses that contain sequences of items,
* just as most recent Blog Posts, or alphabetically ordered list of
* users of a network.
*/
public class ItemSequenceResponse extends ResponseWithResources
{
private List entry;
private String anchorString;
@JsonProperty private Boolean firstPage;
@JsonProperty private Boolean lastPage;
public ItemSequenceResponse() { }
public List getEntry()
{
// for convenience let's ensure it's never null
if (entry == null) {
return Collections.emptyList();
}
return entry;
}
/* due to a minor bug in precedence handling (in Jackson, before version 1.5.5 or so),
* must define a setter here:
*/
@SuppressWarnings("unused")
@JsonProperty
private void setEntry(List entry) { this.entry = entry; }
// ignore so it won't be serialized
@JsonIgnore
public boolean isEmpty() { return (entry == null) || entry.size() == 0; }
@JsonIgnore
public boolean isFirstPage() { return firstPage; }
@JsonIgnore
public boolean isLastPage() { return lastPage; }
public String getAnchor() { return anchorString; }
public void setAnchor(String str) { this.anchorString = str; }
}