1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.yaml.snakeyaml.immutable.primitives;
17
18 public class BunchOfPrimitives {
19 private int primitiveInt;
20 private double primitiveDouble;
21 public boolean primitiveBoolean;
22
23 public BunchOfPrimitives(int primitiveInt, double primitiveDouble, boolean primitiveBoolean) {
24 this.primitiveInt = primitiveInt;
25 this.primitiveDouble = primitiveDouble;
26 this.primitiveBoolean = primitiveBoolean;
27 }
28
29
30
31
32 public BunchOfPrimitives(int i1, int i2, int i3) {
33 this.primitiveInt = i1;
34 }
35
36 public BunchOfPrimitives(long i1, double i2, boolean i3) {
37 this((int) i1, i2, i3);
38 }
39
40 public int getPrimitiveInt() {
41 return primitiveInt;
42 }
43
44 public double getPrimitiveDouble() {
45 return primitiveDouble;
46 }
47
48 @Override
49 public boolean equals(Object obj) {
50 if (obj instanceof BunchOfPrimitives) {
51 BunchOfPrimitives bunch = (BunchOfPrimitives) obj;
52 return primitiveInt == bunch.primitiveInt;
53 } else {
54 return false;
55 }
56 }
57
58 @Override
59 public int hashCode() {
60 return primitiveInt;
61 }
62
63 @Override
64 public String toString() {
65 return "BunchOfPrimitives " + primitiveInt;
66 }
67 }