-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaptop.java
More file actions
89 lines (69 loc) · 2.05 KB
/
Laptop.java
File metadata and controls
89 lines (69 loc) · 2.05 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package ru.MylearnCh1J1L1;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Laptop {
private String name;
private int amountRAM;
private String operatingSystem;
private int price;
private String model;
public Laptop(String name, int amountRAM, String operatingSystem, int price, String model) {
this.name = name;
this.amountRAM = amountRAM;
this.operatingSystem = operatingSystem;
this.price = price;
this.model = model;
}
public boolean validateObject(){
return true;
}
public static List<String> propertiesForFilter(){
List<String> list = new ArrayList<>();
list.add("amountRAM");
list.add("operatingSystem");
list.add("price");
list.add("model");
return list;
}
@Override
public String toString() {
return "Ноутбук: (" + name + "): " +
"количество оперативной памяти: " + amountRAM +
", операционная система: " + operatingSystem + '\'' +
", цена: " + price +
", модель: " + model;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAmountRAM() {
return amountRAM;
}
public void setAmountRAM(int amountRAM) {
this.amountRAM = amountRAM;
}
public String getOperatingSystem() {
return operatingSystem;
}
public void setOperatingSystem(String operatingSystem) {
this.operatingSystem = operatingSystem;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
}