1
2 package de.larssh.jes;
3
4 import static java.util.Collections.unmodifiableList;
5 import java.util.List;
6 import org.apache.commons.net.ftp.FTPClient;
7 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
8
9
10
11
12
13 public class JesLimitReachedException extends JesException {
14
15
16
17 private final int limit;
18
19
20
21 private final transient List<Job> jobs;
22
23
24
25
26
27
28
29
30
31 @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Mutability of jobs.outputs is not expected to be a problem for this exception")
32 public JesLimitReachedException(final int limit, final List<Job> jobs, final FTPClient ftpClient) {
33 super(ftpClient, "Listing limit of %d reached.", limit);
34 this.limit = limit;
35 this.jobs = jobs;
36 }
37
38
39
40
41
42
43 public List<Job> getJobs() {
44 return unmodifiableList(jobs);
45 }
46
47
48
49
50 @Override
51 @SuppressWarnings("PMD.UselessOverridingMethod")
52 public String getMessage() {
53 return super.getMessage();
54 }
55
56
57
58
59
60
61 @java.lang.SuppressWarnings("all")
62 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
63 @lombok.Generated
64 public int getLimit() {
65 return this.limit;
66 }
67
68 @edu.umd.cs.findbugs.annotations.NonNull
69 @java.lang.Override
70 @java.lang.SuppressWarnings("all")
71 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
72 @lombok.Generated
73 public java.lang.String toString() {
74 return "JesLimitReachedException(message=" + this.getMessage() + ", limit=" + this.getLimit() + ", jobs=" + this.getJobs() + ")";
75 }
76
77 @java.lang.Override
78 @java.lang.SuppressWarnings("all")
79 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
80 @lombok.Generated
81 public boolean equals(@edu.umd.cs.findbugs.annotations.Nullable final java.lang.Object o) {
82 if (o == this) return true;
83 if (!(o instanceof JesLimitReachedException)) return false;
84 final JesLimitReachedException other = (JesLimitReachedException) o;
85 if (!other.canEqual((java.lang.Object) this)) return false;
86 if (!super.equals(o)) return false;
87 if (this.getLimit() != other.getLimit()) return false;
88 return true;
89 }
90
91 @java.lang.SuppressWarnings("all")
92 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
93 @lombok.Generated
94 protected boolean canEqual(@edu.umd.cs.findbugs.annotations.Nullable final java.lang.Object other) {
95 return other instanceof JesLimitReachedException;
96 }
97
98 @java.lang.Override
99 @java.lang.SuppressWarnings("all")
100 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
101 @lombok.Generated
102 public int hashCode() {
103 final int PRIME = 59;
104 int result = super.hashCode();
105 result = result * PRIME + this.getLimit();
106 return result;
107 }
108 }