@@ -24,12 +24,14 @@ public class Conversation extends TypedData {
2424 static final String MESSAGE_TYPE_NOTE = "note" ;
2525 static final String MESSAGE_TYPE_CLOSE = "close" ;
2626 static final String MESSAGE_TYPE_OPEN = "open" ;
27+ static final String MESSAGE_TYPE_SNOOZED = "snoozed" ;
2728 static final List <String > MESSAGE_TYPES = Lists .newArrayList (
2829 MESSAGE_TYPE_ASSIGNMENT ,
2930 MESSAGE_TYPE_COMMENT ,
3031 MESSAGE_TYPE_NOTE ,
3132 MESSAGE_TYPE_CLOSE ,
32- MESSAGE_TYPE_OPEN
33+ MESSAGE_TYPE_OPEN ,
34+ MESSAGE_TYPE_SNOOZED
3335 );
3436
3537 public static Conversation find (String id ) throws InvalidException , AuthorizationException {
@@ -196,6 +198,9 @@ private static boolean isAdminQuery(Map<String, String> params) {
196198 @ JsonProperty ("waiting_since" )
197199 private long waitingSince ;
198200
201+ @ JsonProperty ("snoozed_until" )
202+ private long snoozedUntil ;
203+
199204 @ JsonProperty ("conversation_parts" )
200205 private ConversationPartCollection conversationPartCollection ;
201206
@@ -208,6 +213,9 @@ private static boolean isAdminQuery(Map<String, String> params) {
208213 @ JsonProperty ("read" )
209214 private boolean read ;
210215
216+ @ JsonProperty ("state" )
217+ private String state ;
218+
211219 @ JsonProperty ("links" )
212220 private Map <String , URI > links ;
213221
@@ -271,6 +279,10 @@ public long getWaitingSince() {
271279 return waitingSince ;
272280 }
273281
282+ public long getSnoozedUntil () {
283+ return snoozedUntil ;
284+ }
285+
274286 public ConversationPartCollection getConversationPartCollection () {
275287 if (conversationPartCollection == null ) {
276288 conversationPartCollection = find (this .getId ()).getConversationPartCollection ();
@@ -295,6 +307,10 @@ public boolean getRead() {
295307 return read ;
296308 }
297309
310+ public String getState () {
311+ return state ;
312+ }
313+
298314 @ Override
299315 public boolean equals (Object o ) {
300316 if (this == o ) return true ;
@@ -307,6 +323,7 @@ public boolean equals(Object o) {
307323 if (read != that .read ) return false ;
308324 if (updatedAt != that .updatedAt ) return false ;
309325 if (waitingSince != that .waitingSince ) return false ;
326+ if (snoozedUntil != that .snoozedUntil ) return false ;
310327 if (assignee != null ? !assignee .equals (that .assignee ) : that .assignee != null ) return false ;
311328 if (conversationMessage != null ? !conversationMessage .equals (that .conversationMessage ) : that .conversationMessage != null )
312329 return false ;
@@ -316,6 +333,7 @@ public boolean equals(Object o) {
316333 return false ;
317334 if (id != null ? !id .equals (that .id ) : that .id != null ) return false ;
318335 if (links != null ? !links .equals (that .links ) : that .links != null ) return false ;
336+ if (!state .equals (that .state )) return false ;
319337 if (!type .equals (that .type )) return false ;
320338 //noinspection RedundantIfStatement
321339 if (user != null ? !user .equals (that .user ) : that .user != null ) return false ;
@@ -327,12 +345,14 @@ public boolean equals(Object o) {
327345 public int hashCode () {
328346 int result = type .hashCode ();
329347 result = 31 * result + (id != null ? id .hashCode () : 0 );
348+ result = 31 * result + (state != null ? state .hashCode () : 0 );
330349 result = 31 * result + (conversationMessage != null ? conversationMessage .hashCode () : 0 );
331350 result = 31 * result + (user != null ? user .hashCode () : 0 );
332351 result = 31 * result + (assignee != null ? assignee .hashCode () : 0 );
333352 result = 31 * result + (int ) (createdAt ^ (createdAt >>> 32 ));
334353 result = 31 * result + (int ) (updatedAt ^ (updatedAt >>> 32 ));
335354 result = 31 * result + (int ) (waitingSince ^ (waitingSince >>> 32 ));
355+ result = 31 * result + (int ) (snoozedUntil ^ (snoozedUntil >>> 32 ));
336356 result = 31 * result + (conversationPartCollection != null ? conversationPartCollection .hashCode () : 0 );
337357 result = 31 * result + (tagCollection != null ? tagCollection .hashCode () : 0 );
338358 result = 31 * result + (open ? 1 : 0 );
@@ -352,9 +372,11 @@ public String toString() {
352372 ", createdAt=" + createdAt +
353373 ", updatedAt=" + updatedAt +
354374 ", waitingSince=" + waitingSince +
375+ ", snoozedUntil=" + snoozedUntil +
355376 ", conversationPartCollection=" + conversationPartCollection +
356377 ", tagCollection=" + tagCollection +
357378 ", open=" + open +
379+ ", state=" + state +
358380 ", read=" + read +
359381 ", links=" + links +
360382 "} " + super .toString ();
0 commit comments