File tree Expand file tree Collapse file tree
fun-streams/collect/groupby Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .zetcode ;
2+
3+ import java .math .BigDecimal ;
4+
5+ public class Product {
6+
7+ private String name ;
8+ private String category ;
9+ private BigDecimal price ;
10+
11+ public Product (String name , String category , BigDecimal price ) {
12+ this .name = name ;
13+ this .category = category ;
14+ this .price = price ;
15+ }
16+
17+ public String getName () {
18+ return name ;
19+ }
20+
21+ public void setName (String name ) {
22+ this .name = name ;
23+ }
24+
25+ public String getCategory () {
26+ return category ;
27+ }
28+
29+ public void setCategory (String category ) {
30+ this .category = category ;
31+ }
32+
33+ public BigDecimal getPrice () {
34+ return price ;
35+ }
36+
37+ public void setPrice (BigDecimal price ) {
38+ this .price = price ;
39+ }
40+
41+ @ Override
42+ public String toString () {
43+
44+ var sb = new StringBuilder ("Product{" );
45+ sb .append ("name='" ).append (name ).append ('\'' );
46+ sb .append (", category='" ).append (category ).append ('\'' );
47+ sb .append (", price=" ).append (price );
48+ sb .append ('}' );
49+ return sb .toString ();
50+ }
51+ }
You can’t perform that action at this time.
0 commit comments