getTenantId()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 2
rs 10
eloc 2
1
package unicon.matthews.entity.risk;
2
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
6
import org.springframework.data.annotation.Id;
7
import org.springframework.data.mongodb.core.mapping.Document;
8
9
@Document
10
public class RiskScore implements Serializable {
11
  private static final long serialVersionUID = 1L;
12
  
13
  @Id private String id;
14
  private String orgId;
15
  private String tenantId;
16
  private String userSourcedId;
17
  private String classSourcedId;
18
  private LocalDateTime dateTime;
0 ignored issues
show
introduced by
Make this value-based field transient so it is not included in the serialization of this class.
Loading history...
19
  private String modelType;
20
  private String score;
21
  private boolean active;
22
  
23
  private RiskScore() {}
24
25
  public String getId() {
26
    return id;
27
  }
28
29
  public String getOrgId() {
30
    return orgId;
31
  }
32
33
  public String getTenantId() {
34
    return tenantId;
35
  }
36
37
  public String getUserSourcedId() {
38
    return userSourcedId;
39
  }
40
41
  public String getClassSourcedId() {
42
    return classSourcedId;
43
  }
44
45
  public LocalDateTime getDateTime() {
46
    return dateTime;
47
  }
48
49
  public String getModelType() {
50
    return modelType;
51
  }
52
53
  public String getScore() {
54
    return score;
55
  }
56
57
  public boolean isActive() {
58
    return active;
59
  }
60
61
  @Override
62
  public int hashCode() {
63
    final int prime = 31;
64
    int result = 1;
65
    result = prime * result + (active ? 1231 : 1237);
66
    result = prime * result + ((classSourcedId == null) ? 0 : classSourcedId.hashCode());
67
    result = prime * result + ((dateTime == null) ? 0 : dateTime.hashCode());
68
    result = prime * result + ((id == null) ? 0 : id.hashCode());
69
    result = prime * result + ((modelType == null) ? 0 : modelType.hashCode());
70
    result = prime * result + ((orgId == null) ? 0 : orgId.hashCode());
71
    result = prime * result + ((score == null) ? 0 : score.hashCode());
72
    result = prime * result + ((tenantId == null) ? 0 : tenantId.hashCode());
73
    result = prime * result + ((userSourcedId == null) ? 0 : userSourcedId.hashCode());
74
    return result;
75
  }
76
77
  @Override
78
  public boolean equals(Object obj) {
79
    if (this == obj)
80
      return true;
81
    if (obj == null)
82
      return false;
83
    if (getClass() != obj.getClass())
84
      return false;
85
    RiskScore other = (RiskScore) obj;
86
    if (active != other.active)
87
      return false;
88
    if (classSourcedId == null) {
89
      if (other.classSourcedId != null)
90
        return false;
91
    } else if (!classSourcedId.equals(other.classSourcedId))
92
      return false;
93
    if (dateTime == null) {
94
      if (other.dateTime != null)
95
        return false;
96
    } else if (!dateTime.equals(other.dateTime))
97
      return false;
98
    if (id == null) {
99
      if (other.id != null)
100
        return false;
101
    } else if (!id.equals(other.id))
102
      return false;
103
    if (modelType == null) {
104
      if (other.modelType != null)
105
        return false;
106
    } else if (!modelType.equals(other.modelType))
107
      return false;
108
    if (orgId == null) {
109
      if (other.orgId != null)
110
        return false;
111
    } else if (!orgId.equals(other.orgId))
112
      return false;
113
    if (score == null) {
114
      if (other.score != null)
115
        return false;
116
    } else if (!score.equals(other.score))
117
      return false;
118
    if (tenantId == null) {
119
      if (other.tenantId != null)
120
        return false;
121
    } else if (!tenantId.equals(other.tenantId))
122
      return false;
123
    if (userSourcedId == null) {
124
      if (other.userSourcedId != null)
125
        return false;
126
    } else if (!userSourcedId.equals(other.userSourcedId))
127
      return false;
128
    return true;
129
  }
130
131
  public static class Builder {
132
    private RiskScore _riskScore = new RiskScore();
133
    
134
    public Builder withId(String id) {
135
      _riskScore.id = id;
136
      return this;
137
    }
138
    
139
    public Builder withOrgId(String orgId) {
140
      _riskScore.orgId = orgId;
141
      return this;
142
    }
143
    
144
    public Builder withTenantId(String tenantId) {
145
      _riskScore.tenantId = tenantId;
146
      return this;
147
    }
148
    
149
    public Builder withUserSourcedId(String userSourcedId) {
150
      _riskScore.userSourcedId = userSourcedId;
151
      return this;
152
    }
153
    
154
    public Builder withClassSourcedId(String classSourcedId) {
155
      _riskScore.classSourcedId = classSourcedId;
156
      return this;
157
    }
158
159
    public Builder withDateTime(LocalDateTime dateTime) {
160
      _riskScore.dateTime = dateTime;
161
      return this;
162
    }
163
    
164
    public Builder withModelType(String modelType) {
165
      _riskScore.modelType = modelType;
166
      return this;
167
    }
168
    
169
    public Builder withActive(boolean active) {
170
      _riskScore.active = active;
171
      return this;
172
    }
173
    
174
    public RiskScore build() {
175
      return _riskScore;
176
    }
177
  }
178
179
}
180