Revert "BAEL-4134"
This commit is contained in:
committed by
GitHub
parent
dffa1f64e6
commit
485b4e3e99
@@ -1,30 +1,36 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>cqrs-es</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>cqrs-es</name>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>patterns</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.12</version>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.version>4.13</junit.version>
|
||||
<lombok.version>1.18.12</lombok.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
- [A Solid Guide to Solid Principles](https://www.baeldung.com/solid-principles)
|
||||
- [Single Responsibility Principle in Java](https://www.baeldung.com/java-single-responsibility-principle)
|
||||
|
||||
- [Open/Closed Principle in Java](https://www.baeldung.com/java-open-closed-principle)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.baeldung.i.fixed;
|
||||
|
||||
public interface Bank extends Payment {
|
||||
void initiatePayments();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.baeldung.i.fixed;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BankPayment implements Bank {
|
||||
|
||||
@Override
|
||||
public void initiatePayments() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object status() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getPayments() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.baeldung.i.fixed;
|
||||
|
||||
public interface Loan extends Payment {
|
||||
void intiateLoanSettlement();
|
||||
void initiateRePayment();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.baeldung.i.fixed;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoanPayment implements Loan {
|
||||
|
||||
@Override
|
||||
public void intiateLoanSettlement() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiateRePayment() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object status() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getPayments() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.i.fixed;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Payment {
|
||||
Object status();
|
||||
List<Object> getPayments();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.baeldung.i.polluted;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BankPayment implements Payment {
|
||||
|
||||
@Override
|
||||
public void initiatePayments() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object status() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getPayments() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intiateLoanSettlement() {
|
||||
throw new UnsupportedOperationException("This is not a loan payment");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiateRePayment() {
|
||||
throw new UnsupportedOperationException("This is not a loan payment");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.baeldung.i.polluted;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoanPayment implements Payment {
|
||||
|
||||
@Override
|
||||
public void initiatePayments() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object status() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getPayments() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intiateLoanSettlement() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiateRePayment() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.i.polluted;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Payment {
|
||||
void initiatePayments();
|
||||
Object status();
|
||||
List<Object> getPayments();
|
||||
|
||||
//Loan related methods
|
||||
void intiateLoanSettlement();
|
||||
void initiateRePayment();
|
||||
}
|
||||
Reference in New Issue
Block a user