chore: remove default Maven and Gradle project files
This commit is contained in:
@@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.example.adapter.*;
|
|
||||||
import org.example.builder.*;
|
|
||||||
import org.example.chain.*;
|
|
||||||
import org.example.decorator.*;
|
|
||||||
import org.example.proxy.*;
|
|
||||||
import org.example.strategy.*;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
run();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void run() {
|
|
||||||
checkAdapterPattern();
|
|
||||||
|
|
||||||
checkBuilderPattern();
|
|
||||||
|
|
||||||
checkChainPattern();
|
|
||||||
|
|
||||||
checkDecoratorPattern();
|
|
||||||
|
|
||||||
checkProxyPattern();
|
|
||||||
|
|
||||||
checkStrategyPattern();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkAdapterPattern() {
|
|
||||||
Adaptee adaptee = new Adaptee();
|
|
||||||
Target target = new Adapter(adaptee);
|
|
||||||
|
|
||||||
target.methodWithoutArguments();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkBuilderPattern() {
|
|
||||||
Product product =
|
|
||||||
new ProductBuilder().setFirst("first").setSecond("second").setThird(3).build();
|
|
||||||
|
|
||||||
System.out.println(product);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkChainPattern() {
|
|
||||||
Handler handler = new ConcreteHandlerA();
|
|
||||||
handler.setNext(new ConcreteHandlerB());
|
|
||||||
|
|
||||||
handler.handle(42);
|
|
||||||
handler.handle("Hello");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkDecoratorPattern() {
|
|
||||||
Component component = new ConcreteComponent();
|
|
||||||
Component decorator = new ConcreteDecorator(component);
|
|
||||||
|
|
||||||
decorator.operation();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkProxyPattern() {
|
|
||||||
Service service = new ConcreteService();
|
|
||||||
Service proxy = new ServiceProxy(service);
|
|
||||||
|
|
||||||
proxy.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkStrategyPattern() {
|
|
||||||
Context context = new Context(new ConcreteStrategyA());
|
|
||||||
|
|
||||||
boolean crayfishWhistled = true; // Если рак на горе свистнул
|
|
||||||
|
|
||||||
if (crayfishWhistled) {
|
|
||||||
context.setStrategy(new ConcreteStrategyB());
|
|
||||||
}
|
|
||||||
|
|
||||||
context.executeStrategy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*/
|
|
||||||
public class App {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello World!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.example;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rigorous Test :-)
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void shouldAnswerWithTrue() {
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This source file was generated by the Gradle 'init' task
|
|
||||||
*/
|
|
||||||
package org.example;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
|
||||||
@Test void appHasAGreeting() {
|
|
||||||
App classUnderTest = new App();
|
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user