Skip to content

Commit 6e035f7

Browse files
author
coursar
committed
feat(interfaces)
1 parent a82c2ed commit 6e035f7

File tree

16 files changed

+363
-1
lines changed

16 files changed

+363
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434

3535
4.1. [x] [Исключительные ситуации и их обработка. Тестирование исключений](exceptions)
3636

37-
4.2. [ ] [Интерфейсы для организации малой связности. Обобщённое программирование (Generics)](interfaces)
37+
4.2. [x] [Интерфейсы для организации малой связности. Обобщённое программирование (Generics)](interfaces)
3838

3939
4.3. [ ] [Collections Framework. CRUD и тестирование систем, управляющих набором объектов](collections)

interfaces/mfu/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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>mfu</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.projectlombok</groupId>
20+
<artifactId>lombok</artifactId>
21+
<version>1.18.12</version>
22+
<scope>provided</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.junit.jupiter</groupId>
26+
<artifactId>junit-jupiter</artifactId>
27+
<version>5.4.2</version>
28+
<scope>test</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.mockito</groupId>
32+
<artifactId>mockito-junit-jupiter</artifactId>
33+
<version>3.3.3</version>
34+
<scope>test</scope>
35+
</dependency>
36+
</dependencies>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-surefire-plugin</artifactId>
43+
<version>2.22.2</version>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package ru.netology;
2+
3+
import ru.netology.domain.Document;
4+
5+
public interface Printer {
6+
void print(Document document);
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package ru.netology;
2+
3+
import ru.netology.domain.Document;
4+
5+
public interface Scanner {
6+
Document scan();
7+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package ru.netology.domain;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
@NoArgsConstructor
8+
@AllArgsConstructor
9+
@Data
10+
public class Document {
11+
private int id;
12+
private String name;
13+
private String content;
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package ru.netology.hp;
2+
3+
import ru.netology.Printer;
4+
import ru.netology.domain.Document;
5+
6+
public class LJ1210 implements Printer {
7+
@Override
8+
public void print(Document document) {
9+
10+
}
11+
}
12+
13+
14+
15+
16+
17+
18+
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package ru.netology.hp;
2+
3+
import ru.netology.Printer;
4+
import ru.netology.Scanner;
5+
import ru.netology.domain.Document;
6+
7+
public class LJProM283 implements Printer, Scanner {
8+
@Override
9+
public void print(Document document) {
10+
11+
}
12+
13+
@Override
14+
public Document scan() {
15+
return null;
16+
}
17+
}
18+
19+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package ru.netology.service;
2+
3+
import ru.netology.domain.Document;
4+
import ru.netology.Printer;
5+
6+
public class OfficeService {
7+
public void print(Document document, Printer printer) {
8+
printer.print(document);
9+
}
10+
}
11+
12+
13+
14+

interfaces/sorting/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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>sorting</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.projectlombok</groupId>
20+
<artifactId>lombok</artifactId>
21+
<version>1.18.12</version>
22+
<scope>provided</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.junit.jupiter</groupId>
26+
<artifactId>junit-jupiter</artifactId>
27+
<version>5.4.2</version>
28+
<scope>test</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.mockito</groupId>
32+
<artifactId>mockito-junit-jupiter</artifactId>
33+
<version>3.3.3</version>
34+
<scope>test</scope>
35+
</dependency>
36+
</dependencies>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-surefire-plugin</artifactId>
43+
<version>2.22.2</version>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package ru.netology.container;
2+
3+
public class Box {
4+
private Object value;
5+
6+
public Box(Object value) {
7+
this.value = value;
8+
}
9+
10+
public boolean isEmpty() {
11+
return value == null;
12+
}
13+
14+
public Object getValue() {
15+
return value;
16+
}
17+
}

0 commit comments

Comments
 (0)