com.podio.item.Item Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
The official Java wrapper for the Podio API
package com.podio.item;
import java.util.List;
import java.util.Map;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import com.podio.app.ApplicationMicro;
import com.podio.comment.Comment;
import com.podio.conversation.Conversation;
import com.podio.file.File;
import com.podio.rating.RatingType;
import com.podio.rating.RatingTypeKeyDeserializer;
import com.podio.rating.RatingValuesMap;
import com.podio.share.Share;
import com.podio.task.Task;
public class Item {
/**
* The id of the item
*/
private int id;
/**
* The app where the item belongs
*/
private ApplicationMicro application;
/**
* The external id of the item. This can be used to hold a reference to the
* item in an external system.
*/
private String externalId;
/**
* The information on who created the first revision of the item
*/
private ItemRevision initialRevision;
/**
* The latest revision
*/
private ItemRevision currentRevision;
/**
* The title of the item. This is made of up one of the fields below, or by
* the item name and id
*/
private String title;
/**
* The values for each field
*/
private List fields;
/**
* The latest 8 revisions of the item sorted descending by date
*/
private List revisions;
/**
* All the comments on the item
*/
private List comments;
/**
* The ratings on the item
*/
private RatingValuesMap ratings;
/**
* All the conversations on the item that the user is part of
*/
private List conversations;
/**
* The tasks on the item that are public or the user is part of
*/
private List tasks;
/**
* The shares of the item
*/
private List shares;
/**
* The files on the item
*/
private List files;
/**
* The items that reference this item
*/
private List references;
/**
* The tags on the item
*/
private List tags;
/**
* true
if the user is subscribed to the item,
* false
otherwise
*/
private boolean subscribed;
/**
* The ratings and their values done by the active user on the item
*/
private Map userRatings;
@JsonProperty("item_id")
public int getId() {
return id;
}
@JsonProperty("item_id")
public void setId(int id) {
this.id = id;
}
@JsonProperty("app")
public ApplicationMicro getApplication() {
return application;
}
@JsonProperty("app")
public void setApplication(ApplicationMicro application) {
this.application = application;
}
@JsonProperty("external_id")
public String getExternalId() {
return externalId;
}
@JsonProperty("external_id")
public void setExternalId(String externalId) {
this.externalId = externalId;
}
@JsonProperty("initial_revision")
public ItemRevision getInitialRevision() {
return initialRevision;
}
@JsonProperty("initial_revision")
public void setInitialRevision(ItemRevision initialRevision) {
this.initialRevision = initialRevision;
}
@JsonProperty("current_revision")
public ItemRevision getCurrentRevision() {
return currentRevision;
}
@JsonProperty("current_revision")
public void setCurrentRevision(ItemRevision currentRevision) {
this.currentRevision = currentRevision;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List getFields() {
return fields;
}
public void setFields(List fields) {
this.fields = fields;
}
public List getRevisions() {
return revisions;
}
public void setRevisions(List revisions) {
this.revisions = revisions;
}
public List getComments() {
return comments;
}
public void setComments(List comments) {
this.comments = comments;
}
public RatingValuesMap getRatings() {
return ratings;
}
public void setRatings(RatingValuesMap ratings) {
this.ratings = ratings;
}
public List getConversations() {
return conversations;
}
public void setConversations(List conversations) {
this.conversations = conversations;
}
public List getTasks() {
return tasks;
}
public void setTasks(List tasks) {
this.tasks = tasks;
}
public List getShares() {
return shares;
}
public void setShares(List shares) {
this.shares = shares;
}
public List getFiles() {
return files;
}
public void setFiles(List files) {
this.files = files;
}
public List getReferences() {
return references;
}
public void setReferences(List references) {
this.references = references;
}
public List getTags() {
return tags;
}
public void setTags(List tags) {
this.tags = tags;
}
public boolean isSubscribed() {
return subscribed;
}
public void setSubscribed(boolean subscribed) {
this.subscribed = subscribed;
}
public Integer getUserRating(RatingType type) {
return userRatings.get(type);
}
public Map getUserRatings() {
return userRatings;
}
@JsonDeserialize(keyUsing = RatingTypeKeyDeserializer.class)
@JsonProperty("user_ratings")
public void setUserRatings(Map userRatings) {
this.userRatings = userRatings;
}
}