Sync Factory Method, Abstract Factory, Builder, Prototype to Java 25; fix post/code mismatches
This commit is contained in:
11
01-creational/factory-method/SlackNotification.java
Normal file
11
01-creational/factory-method/SlackNotification.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package factorymethod;
|
||||
|
||||
// New Concrete Product — knows how to send to Slack
|
||||
public class SlackNotification implements Notification {
|
||||
@Override
|
||||
public void send(String recipient, String message) {
|
||||
System.out.printf(" [SLACK] Channel: %s | Message: %s%n", recipient, message);
|
||||
}
|
||||
@Override
|
||||
public String getType() { return "SLACK"; }
|
||||
}
|
||||
Reference in New Issue
Block a user