diff --git a/src/main/java/com/taskadapter/redmineapi/bean/Journal.java b/src/main/java/com/taskadapter/redmineapi/bean/Journal.java index 35a8ca75..be33c22a 100644 --- a/src/main/java/com/taskadapter/redmineapi/bean/Journal.java +++ b/src/main/java/com/taskadapter/redmineapi/bean/Journal.java @@ -20,6 +20,7 @@ public class Journal { public final static Property NOTES = new Property(String.class, "notes"); public final static Property USER = new Property<>(User.class, "user"); public final static Property CREATED_ON = new Property<>(Date.class, "createdOn"); + public final static Property PRIVATE_NOTES = new Property<>(Boolean.class, "privateNotes"); public final static Property> DETAILS = (Property>) new Property(List.class, "details"); public Journal() { @@ -69,6 +70,14 @@ public List getDetails() { public void addDetails(Collection details) { storage.get(DETAILS).addAll(details); } + + public Boolean isPrivateNotes() { + return storage.get(PRIVATE_NOTES); + } + + public void setIsPrivateNotes(Boolean isPrivate) { + storage.set(PRIVATE_NOTES, isPrivate); + } @Override public boolean equals(Object o) { diff --git a/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONParser.java b/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONParser.java index 5f1f563e..f5ef580d 100644 --- a/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONParser.java +++ b/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONParser.java @@ -332,6 +332,7 @@ public static Journal parseJournal(JSONObject content) throws JSONException { result.setCreatedOn(getDateOrNull(content, "created_on")); result.setNotes(JsonInput.getStringOrNull(content, "notes")); result.setUser(JsonInput.getObjectOrNull(content, "user", RedmineJSONParser::parseUser)); + result.setIsPrivateNotes(JsonInput.getOptionalBool(content, "private_notes")); result.addDetails(JsonInput.getListOrEmpty(content, "details", RedmineJSONParser::parseJournalDetail)); return result; }