11package com .duosecurity .model ;
22
33import java .io .Serializable ;
4- import lombok . Data ;
4+ import java . util . Objects ;
55
6- @ Data
76public class AuthContext implements Serializable {
87 private static final long serialVersionUID = -2431823399834806194L ;
98
@@ -16,5 +15,187 @@ public class AuthContext implements Serializable {
1615 private AccessDevice access_device ;
1716 private Application application ;
1817 private String factor ;
19- private User user ;
18+ private User user ;
19+
20+ /**
21+ * Constructor with all properties.
22+ *
23+ * @param result result
24+ * @param timestamp timestamp
25+ * @param authDevice auth_device
26+ * @param txid txid
27+ * @param eventType event_type
28+ * @param reason reason
29+ * @param accessDevice access_device
30+ * @param application application
31+ * @param factor factor
32+ * @param user user
33+ */
34+ public AuthContext (String result , Integer timestamp , AuthDevice authDevice , String txid ,
35+ String eventType , String reason , AccessDevice accessDevice , Application application ,
36+ String factor , User user ) {
37+ this .result = result ;
38+ this .timestamp = timestamp ;
39+ this .auth_device = authDevice ;
40+ this .txid = txid ;
41+ this .event_type = eventType ;
42+ this .reason = reason ;
43+ this .access_device = accessDevice ;
44+ this .application = application ;
45+ this .factor = factor ;
46+ this .user = user ;
47+ }
48+
49+ public AuthContext () {
50+ }
51+
52+ public static long getSerialversionuid () {
53+ return serialVersionUID ;
54+ }
55+
56+ public String getResult () {
57+ return result ;
58+ }
59+
60+ public void setResult (String result ) {
61+ this .result = result ;
62+ }
63+
64+ public Integer getTimestamp () {
65+ return timestamp ;
66+ }
67+
68+ public void setTimestamp (Integer timestamp ) {
69+ this .timestamp = timestamp ;
70+ }
71+
72+ public AuthDevice getAuth_device () {
73+ return auth_device ;
74+ }
75+
76+ public void setAuth_device (AuthDevice authDevice ) {
77+ this .auth_device = authDevice ;
78+ }
79+
80+ public String getTxid () {
81+ return txid ;
82+ }
83+
84+ public void setTxid (String txid ) {
85+ this .txid = txid ;
86+ }
87+
88+ public String getEvent_type () {
89+ return event_type ;
90+ }
91+
92+ public void setEvent_type (String eventType ) {
93+ this .event_type = eventType ;
94+ }
95+
96+ public String getReason () {
97+ return reason ;
98+ }
99+
100+ public void setReason (String reason ) {
101+ this .reason = reason ;
102+ }
103+
104+ public AccessDevice getAccess_device () {
105+ return access_device ;
106+ }
107+
108+ public void setAccess_device (AccessDevice accessDevice ) {
109+ this .access_device = accessDevice ;
110+ }
111+
112+ public Application getApplication () {
113+ return application ;
114+ }
115+
116+ public void setApplication (Application application ) {
117+ this .application = application ;
118+ }
119+
120+ public String getFactor () {
121+ return factor ;
122+ }
123+
124+ public void setFactor (String factor ) {
125+ this .factor = factor ;
126+ }
127+
128+ public User getUser () {
129+ return user ;
130+ }
131+
132+ public void setUser (User user ) {
133+ this .user = user ;
134+ }
135+
136+ @ Override
137+ public String toString () {
138+ return "AuthContext [result=" + result
139+ + ", timestamp=" + timestamp
140+ + ", auth_device=" + auth_device
141+ + ", txid=" + txid
142+ + ", event_type=" + event_type
143+ + ", reason=" + reason
144+ + ", access_device=" + access_device
145+ + ", application=" + application
146+ + ", factor=" + factor
147+ + ", user=" + user
148+ + ", getAccess_device()=" + getAccess_device ()
149+ + ", getApplication()=" + getApplication ()
150+ + ", getAuth_device()=" + getAuth_device ()
151+ + ", getEvent_type()=" + getEvent_type ()
152+ + ", getFactor()=" + getFactor ()
153+ + ", getReason()=" + getReason ()
154+ + ", getResult()=" + getResult ()
155+ + ", getTimestamp()=" + getTimestamp ()
156+ + ", getTxid()=" + getTxid ()
157+ + ", getUser()=" + getUser ()
158+ + ", hashCode()=" + hashCode ()
159+ + ", getClass()=" + getClass ()
160+ + ", toString()=" + super .toString ()
161+ + "]" ;
162+ }
163+
164+ @ Override
165+ public boolean equals (Object obj ) {
166+ if (this == obj ) {
167+ return true ;
168+ }
169+ if (obj == null || getClass () != obj .getClass ()) {
170+ return false ;
171+ }
172+ AuthContext other = (AuthContext ) obj ;
173+ return Objects .equals (result , other .result )
174+ && Objects .equals (timestamp , other .timestamp )
175+ && Objects .equals (auth_device , other .auth_device )
176+ && Objects .equals (txid , other .txid )
177+ && Objects .equals (event_type , other .event_type )
178+ && Objects .equals (reason , other .reason )
179+ && Objects .equals (access_device , other .access_device )
180+ && Objects .equals (application , other .application )
181+ && Objects .equals (factor , other .factor )
182+ && Objects .equals (user , other .user );
183+ }
184+
185+ @ Override
186+ public int hashCode () {
187+ final int prime = 31 ;
188+ int result = 1 ;
189+ result = prime * result + ((this .result == null ) ? 0 : this .result .hashCode ());
190+ result = prime * result + ((timestamp == null ) ? 0 : timestamp .hashCode ());
191+ result = prime * result + ((auth_device == null ) ? 0 : auth_device .hashCode ());
192+ result = prime * result + ((txid == null ) ? 0 : txid .hashCode ());
193+ result = prime * result + ((event_type == null ) ? 0 : event_type .hashCode ());
194+ result = prime * result + ((reason == null ) ? 0 : reason .hashCode ());
195+ result = prime * result + ((access_device == null ) ? 0 : access_device .hashCode ());
196+ result = prime * result + ((application == null ) ? 0 : application .hashCode ());
197+ result = prime * result + ((factor == null ) ? 0 : factor .hashCode ());
198+ result = prime * result + ((user == null ) ? 0 : user .hashCode ());
199+ return result ;
200+ }
20201}
0 commit comments