View Javadoc

1   package com.atlassian.jira.rest.client.api.domain;
2   
3   import com.google.common.base.Objects;
4   
5   import javax.annotation.Nullable;
6   
7   /**
8    * Represents record from JIRA Audit Log.
9    *
10   * @since v2.0
11   */
12  public class AuditRecordInput {
13  
14      private final String summary;
15  
16      private final String category;
17  
18      @Nullable
19      private final AuditAssociatedItem objectItem;
20  
21      @Nullable
22      private final Iterable<AuditAssociatedItem> associatedItem;
23  
24      @Nullable
25      private final Iterable<AuditChangedValue> changedValues;
26  
27      public AuditRecordInput(final String category, final String summary,
28                              @Nullable final AuditAssociatedItem objectItem,
29                              @Nullable final Iterable<AuditAssociatedItem> associatedItem,
30                              @Nullable final Iterable<AuditChangedValue> changedValues) {
31          this.summary = summary;
32          this.category = category;
33          this.objectItem = objectItem;
34          this.associatedItem = associatedItem;
35          this.changedValues = changedValues;
36      }
37  
38      public String getSummary() {
39          return summary;
40      }
41  
42      public String getCategory() {
43          return category;
44      }
45  
46      public AuditAssociatedItem getObjectItem() {
47          return objectItem;
48      }
49  
50      public Iterable<AuditAssociatedItem> getAssociatedItems() {
51          return associatedItem;
52      }
53  
54      public Iterable<AuditChangedValue> getChangedValues() {
55          return changedValues;
56      }
57  
58      protected Objects.ToStringHelper getToStringHelper() {
59          return Objects.toStringHelper(this).
60                  add("summary", summary).
61                  add("category", category).
62                  add("objectItem", objectItem).
63                  add("associatedItem", associatedItem).
64                  add("changedValues", changedValues);
65      }
66  
67      @Override
68      public boolean equals(final Object o) {
69          if (o instanceof AuditRecordInput) {
70              final AuditRecordInput that = (AuditRecordInput) o;
71              return Objects.equal(this.summary, that.summary)
72                      && Objects.equal(this.category, that.category)
73                      && Objects.equal(this.objectItem, that.objectItem)
74                      && Objects.equal(this.associatedItem, that.associatedItem)
75                      && Objects.equal(this.changedValues, that.changedValues);
76          }
77          return false;
78      }
79  
80      @Override
81      public int hashCode() {
82          return Objects.hashCode(summary, category, objectItem, associatedItem, changedValues);
83      }
84  
85  }