Skip to content

Commit 6144524

Browse files
author
coursar
committed
feat(oop2)
1 parent ff966ab commit 6144524

File tree

6 files changed

+169
-1
lines changed

6 files changed

+169
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
3.1. [x] [Объектно-ориентированное программирование и проектирование](oop1)
2424

25-
3.2. [ ] [Объектно-ориентированное программирование: ключевые принципы](oop2)
25+
3.2. [x] [Объектно-ориентированное программирование: ключевые принципы](oop2)
2626

2727
3.3. [ ] [Объекты с внутренним состоянием, управление состоянием при тестировании](state)
2828

oop2/principles/pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>ru.netology</groupId>
8+
<artifactId>principles</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<maven.compiler.source>11</maven.compiler.source>
13+
<maven.compiler.target>11</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.junit.jupiter</groupId>
20+
<artifactId>junit-jupiter</artifactId>
21+
<version>5.4.2</version>
22+
<scope>test</scope>
23+
</dependency>
24+
</dependencies>
25+
26+
<build>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-surefire-plugin</artifactId>
31+
<version>2.22.2</version>
32+
</plugin>
33+
</plugins>
34+
</build>
35+
36+
</project>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package ru.netology.domain;
2+
3+
public class Conditioner {
4+
private int id;
5+
private String name = "noname";
6+
private int maxTemperature = 30;
7+
private int minTemperature = 15;
8+
private int currentTemperature = 20;
9+
private boolean on;
10+
11+
public int getId() {
12+
return id;
13+
}
14+
15+
public void setId(int id) {
16+
this.id = id;
17+
}
18+
19+
public String getName() {
20+
return name;
21+
}
22+
23+
public void setName(String name) {
24+
this.name = name;
25+
}
26+
27+
public int getMaxTemperature() {
28+
return maxTemperature;
29+
}
30+
31+
public void setMaxTemperature(int maxTemperature) {
32+
this.maxTemperature = maxTemperature;
33+
}
34+
35+
public int getMinTemperature() {
36+
return minTemperature;
37+
}
38+
39+
public void setMinTemperature(int minTemperature) {
40+
this.minTemperature = minTemperature;
41+
}
42+
43+
public int getCurrentTemperature() {
44+
return currentTemperature;
45+
}
46+
47+
public void setCurrentTemperature(int currentTemperature) {
48+
this.currentTemperature = currentTemperature;
49+
}
50+
51+
public boolean isOn() {
52+
return on;
53+
}
54+
55+
public void setOn(boolean on) {
56+
this.on = on;
57+
}
58+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package ru.netology.domain;
2+
3+
public class Movie {
4+
private String id;
5+
private String imageUrl;
6+
private String name;
7+
private String genre;
8+
9+
public String getId() {
10+
return id;
11+
}
12+
13+
public void setId(String id) {
14+
this.id = id;
15+
}
16+
17+
public String getImageUrl() {
18+
return imageUrl;
19+
}
20+
21+
public void setImageUrl(String imageUrl) {
22+
this.imageUrl = imageUrl;
23+
}
24+
25+
public String getName() {
26+
return name;
27+
}
28+
29+
public void setName(String name) {
30+
this.name = name;
31+
}
32+
33+
public String getGenre() {
34+
return genre;
35+
}
36+
37+
public void setGenre(String genre) {
38+
this.genre = genre;
39+
}
40+
}
41+
42+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package ru.netology.manager;
2+
3+
import ru.netology.domain.Movie;
4+
5+
public class MainPageManager {
6+
private MovieManager movieManager;
7+
8+
/**
9+
* Main Page generation
10+
*/
11+
public String generate() {
12+
Movie[] movies = movieManager.getMoviesForFeed();
13+
// TODO: add logic
14+
for (Movie movie : movies) {
15+
String block = movie.getGenre();
16+
}
17+
return null;
18+
}
19+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package ru.netology.manager;
2+
3+
import ru.netology.domain.Movie;
4+
5+
public class MovieManager {
6+
private Movie[] movies;
7+
8+
public Movie[] getMoviesForFeed() {
9+
// TODO: add logic
10+
return null;
11+
}
12+
}
13+

0 commit comments

Comments
 (0)