1 package com.atlassian.plugins.rest.doclet.generators.schema;
2
3 import com.google.common.base.MoreObjects;
4 import com.google.common.base.Preconditions;
5
6 import java.util.Objects;
7
8 public class PatternedProperties {
9
10 private final String pattern;
11 private final ModelClass valuesType;
12
13 public PatternedProperties(String pattern, ModelClass valuesType) {
14 this.pattern = Preconditions.checkNotNull(pattern);
15 this.valuesType = Preconditions.checkNotNull(valuesType);
16 }
17
18 public String getPattern() {
19 return pattern;
20 }
21
22 public ModelClass getValuesType() {
23 return valuesType;
24 }
25
26 @Override
27 public boolean equals(Object o) {
28 if (this == o) {
29 return true;
30 }
31 if (o == null || getClass() != o.getClass()) {
32 return false;
33 }
34
35 PatternedProperties that = (PatternedProperties) o;
36
37 return Objects.equals(this.pattern, that.pattern) &&
38 Objects.equals(this.valuesType, that.valuesType);
39 }
40
41 @Override
42 public int hashCode() {
43 return Objects.hash(pattern, valuesType);
44 }
45
46 @Override
47 public String toString() {
48 return MoreObjects.toStringHelper(this)
49 .add("pattern", pattern)
50 .add("valuesType", valuesType)
51 .toString();
52 }
53 }