Skip to content

Commit

Permalink
Quick util method for the noop on configuraiton handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
marchermans committed Nov 14, 2023
1 parent 53449a9 commit 708da11
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ public interface IConfigurationPayloadHandler<T extends CustomPacketPayload> {
* @param payload The payload.
*/
void handle(ConfigurationPayloadContext context, T payload);

/**
* Creates a handler that does nothing.
*
* @return The handler.
* @param <Z> The type of payload.
*/
static <Z extends CustomPacketPayload> IConfigurationPayloadHandler<Z> noop() {
return (context, payload) -> {};
}
}

0 comments on commit 708da11

Please sign in to comment.