Simplify construction of spam reporting token providers
This commit is contained in:
parent
cb72158abc
commit
b041566aba
|
@ -23,16 +23,6 @@ public interface ReportSpamTokenProvider {
|
||||||
* @return the provider
|
* @return the provider
|
||||||
*/
|
*/
|
||||||
static ReportSpamTokenProvider noop() {
|
static ReportSpamTokenProvider noop() {
|
||||||
return create(c -> Optional.empty());
|
return context -> Optional.empty();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provider which generates ReportSpamTokens using the given function
|
|
||||||
*
|
|
||||||
* @param fn function from message requests to optional tokens
|
|
||||||
* @return the provider
|
|
||||||
*/
|
|
||||||
static ReportSpamTokenProvider create(Function<ContainerRequestContext, Optional<byte[]>> fn) {
|
|
||||||
return fn::apply;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue