generated from JavaLabs2025/reflection-template
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathProduct.java
More file actions
53 lines (42 loc) · 1000 Bytes
/
Product.java
File metadata and controls
53 lines (42 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package org.example.classes;
import org.example.annotation.Generatable;
@Generatable
public class Product {
private String name;
private double price;
public Product(String name, double price) {
this.name = name;
this.price = price;
}
public Product(String name) {
this.name = name;
this.price = Double.MIN_VALUE;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
@Override
public String toString() {
return "Product{" +
"name='" + name + '\'' +
", price=" + price +
'}';
}
}