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