forked from intercom/intercom-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorCollection.java
More file actions
33 lines (25 loc) · 886 Bytes
/
Copy pathErrorCollection.java
File metadata and controls
33 lines (25 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package io.intercom.api;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public final class ErrorCollection {
@JsonProperty("errors")
private List<Error> errors;
// for jackson
ErrorCollection() {
}
public ErrorCollection(List<Error> errors) {
Preconditions.checkNotNull(errors, "cannot create an error collection with a null error list");
Preconditions.checkArgument(errors.size() > 0, "cannot create an error collection with an empty error list");
this.errors = errors;
}
public List<Error> getErrors() {
return errors;
}
public String getType() {
return "error.list";
}
}