1+ package com .coscale .client .requests ;
2+
3+ import java .util .List ;
4+
5+ import javax .annotation .Nullable ;
6+
7+ import com .coscale .sdk .client .commons .Protocol ;
8+ import com .coscale .sdk .client .metrics .State ;
9+ import com .google .common .base .MoreObjects ;
10+ import com .google .common .base .Objects ;
11+
12+ public class Request {
13+
14+ @ Nullable
15+ public Protocol protocol ;
16+
17+ public State state ;
18+
19+ @ Nullable
20+ public String classifierConfig ;
21+
22+ @ Nullable
23+ public Long version ;
24+
25+ @ Nullable
26+ public Long id ;
27+
28+ @ Nullable
29+ public Long parentId ;
30+
31+ @ Nullable
32+ public RequestClassifierType classifierType ;
33+
34+ @ Nullable
35+ public List <Request > requests ;
36+
37+ @ Nullable
38+ public String source ;
39+
40+ @ Nullable
41+ public String description ;
42+
43+ @ Nullable
44+ public Integer priority ;
45+
46+ @ Nullable
47+ public String name ;
48+
49+ public Request (State state ) {
50+ this .state = state ;
51+ }
52+
53+ public Request (Protocol protocol , State state , String classifierConfig , Long version , Long id ,
54+ Long parentId , RequestClassifierType classifierType , List <Request > requests ,
55+ String source , String description , Integer priority , String name ) {
56+ this .protocol = protocol ;
57+ this .state = state ;
58+ this .classifierConfig = classifierConfig ;
59+ this .version = version ;
60+ this .id = id ;
61+ this .parentId = parentId ;
62+ this .classifierType = classifierType ;
63+ this .requests = requests ;
64+ this .source = source ;
65+ this .description = description ;
66+ this .priority = priority ;
67+ this .name = name ;
68+ }
69+
70+ public Request () {
71+ }
72+
73+ @ Override
74+ public String toString () {
75+ return MoreObjects .toStringHelper (this ).add ("protocol" , protocol ).add ("state" , state )
76+ .add ("classifierConfig" , classifierConfig ).add ("version" , version ).add ("id" , id )
77+ .add ("parentId" , parentId ).add ("classifierType" , classifierType )
78+ .add ("requests" , requests ).add ("source" , source ).add ("description" , description )
79+ .add ("priority" , priority ).add ("name" , name ).toString ();
80+ }
81+
82+ @ Override
83+ public boolean equals (Object obj ) {
84+ if (obj == null ) {
85+ return false ;
86+ }
87+ if (getClass () != obj .getClass ()) {
88+ return false ;
89+ }
90+ final Request other = (Request ) obj ;
91+
92+ return Objects .equal (this .protocol , other .protocol )
93+ && Objects .equal (this .state , other .state )
94+ && Objects .equal (this .classifierConfig , other .classifierConfig )
95+ && Objects .equal (this .version , other .version ) && Objects .equal (this .id , other .id )
96+ && Objects .equal (this .parentId , other .parentId )
97+ && Objects .equal (this .classifierType , other .classifierType )
98+ && Objects .equal (this .requests , other .requests )
99+ && Objects .equal (this .source , other .source )
100+ && Objects .equal (this .description , other .description )
101+ && Objects .equal (this .priority , other .priority )
102+ && Objects .equal (this .name , other .name );
103+ }
104+
105+ @ Override
106+ public int hashCode () {
107+ return Objects .hashCode (protocol , state , classifierConfig , version , id , parentId ,
108+ classifierType , requests , source , description , priority , name );
109+ }
110+
111+ }
0 commit comments