88
99/** Java implementation for TRex python sdk ASTFIpGenDist class */
1010public class ASTFIpGenDist {
11- private static List <Inner > inList = new ArrayList ();
12- private String ipStart ;
13- private String ipEnd ;
14- private Distribution distribution ;
15- private PerCoreDistributionVals perCoreDistributionVals ;
11+ private static List <Inner > inList = new ArrayList <>();
1612 private Inner newInner ;
1713 private int index ;
1814
@@ -39,10 +35,6 @@ public ASTFIpGenDist(
3935 String ipEnd ,
4036 Distribution distribution ,
4137 PerCoreDistributionVals perCoreDistributionVals ) {
42- this .ipStart = ipStart ;
43- this .ipEnd = ipEnd ;
44- this .distribution = distribution ;
45- this .perCoreDistributionVals = perCoreDistributionVals ;
4638 this .newInner = new Inner (ipStart , ipEnd , distribution , perCoreDistributionVals );
4739
4840 for (int i = 0 ; i < inList .size (); i ++) {
@@ -51,7 +43,7 @@ public ASTFIpGenDist(
5143 return ;
5244 }
5345 }
54- this .inList .add (newInner );
46+ ASTFIpGenDist .inList .add (newInner );
5547 this .index = inList .size () - 1 ;
5648 }
5749
@@ -61,7 +53,7 @@ public ASTFIpGenDist(
6153 * @return ip start
6254 */
6355 public String getIpStart () {
64- return this .inList .get (this .index ).getIpStart ();
56+ return ASTFIpGenDist .inList .get (this .index ).getIpStart ();
6557 }
6658
6759 /**
@@ -70,7 +62,7 @@ public String getIpStart() {
7062 * @return ip end
7163 */
7264 public String getIpEnd () {
73- return this .inList .get (this .index ).getIpEnd ();
65+ return ASTFIpGenDist .inList .get (this .index ).getIpEnd ();
7466 }
7567
7668 /**
@@ -79,7 +71,7 @@ public String getIpEnd() {
7971 * @return distribution
8072 */
8173 public Distribution getDistribution () {
82- return this .inList .get (this .index ).getDistribution ();
74+ return ASTFIpGenDist .inList .get (this .index ).getDistribution ();
8375 }
8476
8577 /**
@@ -88,7 +80,7 @@ public Distribution getDistribution() {
8880 * @return perCoreDistributionVals
8981 */
9082 public PerCoreDistributionVals getPerCoreDistributionVals () {
91- return this .inList .get (this .index ).getPerCoreDistributionVals ();
83+ return ASTFIpGenDist .inList .get (this .index ).getPerCoreDistributionVals ();
9284 }
9385
9486 /**
@@ -97,7 +89,7 @@ public PerCoreDistributionVals getPerCoreDistributionVals() {
9789 * @param direction direction
9890 */
9991 public void setDirection (String direction ) {
100- this .inList .get (this .index ).setDirection (direction );
92+ ASTFIpGenDist .inList .get (this .index ).setDirection (direction );
10193 }
10294
10395 /**
@@ -106,7 +98,7 @@ public void setDirection(String direction) {
10698 * @param ipOffset ipOffset
10799 */
108100 public void setIpOffset (String ipOffset ) {
109- this .inList .get (this .index ).setIpOffset (ipOffset );
101+ ASTFIpGenDist .inList .get (this .index ).setIpOffset (ipOffset );
110102 }
111103
112104 /**
@@ -144,10 +136,6 @@ class Inner {
144136 private String ipEnd ;
145137 private Distribution distribution ;
146138 private PerCoreDistributionVals perCoreDistributionVals ;
147-
148- private String direction ;
149- private String ipOffset ;
150-
151139 private JsonObject fields = new JsonObject ();
152140
153141 /**
@@ -189,12 +177,10 @@ PerCoreDistributionVals getPerCoreDistributionVals() {
189177
190178 void setDirection (String direction ) {
191179 fields .addProperty ("dir" , direction );
192- this .direction = direction ;
193180 }
194181
195182 void setIpOffset (String ipOffset ) {
196183 fields .addProperty ("ip_offset" , ipOffset );
197- this .ipOffset = ipOffset ;
198184 }
199185
200186 JsonObject toJson () {
@@ -203,8 +189,12 @@ JsonObject toJson() {
203189
204190 @ Override
205191 public boolean equals (Object o ) {
206- if (this == o ) return true ;
207- if (o == null || getClass () != o .getClass ()) return false ;
192+ if (this == o ) {
193+ return true ;
194+ }
195+ if (o == null || getClass () != o .getClass ()) {
196+ return false ;
197+ }
208198 Inner inner = (Inner ) o ;
209199 return fields .equals (inner .fields );
210200 }
0 commit comments