1
0
Fork 0

Merge pull request #193 from dgigon/develop

Added Visibility
master
Bob Carroll 2017-07-02 12:23:56 -07:00 committed by GitHub
commit 34a5e9450c
3 changed files with 45 additions and 0 deletions

View File

@ -37,6 +37,12 @@ public class Comment extends Resource {
private Date updated = null;
private User updatedAuthor = null;
public Visibility getVisibility() {
return visibility;
}
private Visibility visibility = null;
/**
* Creates a comment from a JSON payload.
*
@ -61,6 +67,8 @@ public class Comment extends Resource {
created = Field.getDateTime(map.get("created"));
updated = Field.getDateTime(map.get("updated"));
updatedAuthor = Field.getResource(User.class, map.get("updatedAuthor"), restclient);
Object obj = map.get("visibility");
visibility = Field.getResource(Visibility.class, map.get("visibility"),restclient);
}
/**

View File

@ -411,6 +411,8 @@ public final class Field {
result = (T)new Transition(restclient, (JSONObject)r);
else if (type == User.class)
result = (T)new User(restclient, (JSONObject)r);
else if (type == Visibility.class)
result = (T)new Visibility(restclient, (JSONObject)r);
else if (type == Version.class)
result = (T)new Version(restclient, (JSONObject)r);
else if (type == Votes.class)

View File

@ -0,0 +1,35 @@
package net.rcarz.jiraclient;
import net.sf.json.JSONObject;
import java.util.Map;
/**
* Created by dgigon on 14/09/16.
*/
public class Visibility extends Resource {
private String type;
private String value;
public String getValue() {
return value;
}
public String getType() {
return type;
}
protected Visibility(RestClient restclient, JSONObject json) {
super(restclient);
if (json != null)
deserialise(json);
}
private void deserialise(JSONObject json) {
Map map = json;
type = Field.getString(map.get("type"));
value = Field.getString(map.get("value"));
}
}