-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProjectionDefinitions.java
More file actions
44 lines (33 loc) · 1.29 KB
/
ProjectionDefinitions.java
File metadata and controls
44 lines (33 loc) · 1.29 KB
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
34
35
36
37
38
39
40
41
42
43
44
package io.serialized.client.projection;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE;
public class ProjectionDefinitions {
private List<ProjectionDefinition> definitions;
public static ProjectionDefinitions newDefinitionList(Collection<ProjectionDefinition> definitions) {
ProjectionDefinitions projectionDefinitions = new ProjectionDefinitions();
projectionDefinitions.definitions = new ArrayList<>(definitions);
return projectionDefinitions;
}
public List<ProjectionDefinition> definitions() {
return definitions == null ? emptyList() : unmodifiableList(definitions);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object obj) {
return EqualsBuilder.reflectionEquals(this, obj);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, SHORT_PREFIX_STYLE);
}
}