View Javadoc

1   package com.atlassian.jira.rest.client.api.domain;
2   
3   import com.google.common.base.Objects;
4   
5   /**
6    * Represents audit search metadata and audit result records
7    */
8   public class AuditRecordsData {
9   
10      private final Integer offset;
11      private final Integer limit;
12      private final Integer total;
13      private final Iterable<AuditRecord> records;
14  
15      public AuditRecordsData(final Integer offset, final Integer limit, final Integer total, final Iterable<AuditRecord> records) {
16          this.offset = offset;
17          this.limit = limit;
18          this.total = total;
19          this.records = records;
20      }
21  
22      public Integer getOffset() {
23          return offset;
24      }
25  
26      public Integer getLimit() {
27          return limit;
28      }
29  
30      public Integer getTotal() {
31          return total;
32      }
33  
34      public Iterable<AuditRecord> getRecords() {
35          return records;
36      }
37  
38      protected Objects.ToStringHelper getToStringHelper() {
39          return Objects.toStringHelper(this).
40                  add("offset", offset).
41                  add("limit", limit).
42                  add("total", total).
43                  add("records", records);
44      }
45  
46      @Override
47      public boolean equals(final Object o) {
48          if (o instanceof AuditRecordsData) {
49              final AuditRecordsData that = (AuditRecordsData) o;
50              return Objects.equal(this.offset, that.offset)
51                      && Objects.equal(this.limit, that.limit)
52                      && Objects.equal(this.total, that.total)
53                      && Objects.equal(this.records, that.records);
54          }
55          return false;
56      }
57  
58      @Override
59      public int hashCode() {
60          return Objects.hashCode(offset, limit, total, records);
61      }
62  }