Move notification API to Nenjim
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
package com.r35157.libs.notification;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public interface AddressedNotifier<
|
||||||
|
D extends NotificationDestination,
|
||||||
|
M extends NotificationMessage>
|
||||||
|
{
|
||||||
|
void push(D destination, M message) throws IOException;
|
||||||
|
|
||||||
|
default BoundNotifier<M> bind(D destination) {
|
||||||
|
return message -> push(destination, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.r35157.libs.notification;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public interface BoundNotifier<M extends NotificationMessage> {
|
||||||
|
void push(M message) throws IOException;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package com.r35157.libs.notification;
|
||||||
|
|
||||||
|
public interface NotificationDestination {}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package com.r35157.libs.notification;
|
||||||
|
|
||||||
|
public interface NotificationMessage {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user