@FunctionalInterface public interface DocServiceFilter
DocService.
You can compose as many filters as you want to include or exclude service methods using
DocServiceBuilder.include(DocServiceFilter) and DocServiceBuilder.exclude(DocServiceFilter).
For example:
// Include Thrift and gRPC only.
DocServiceBuilder builder = DocService.builder();
DocServiceFilter filter = DocServiceFilter.ofThrift().or(DocServiceFilter.ofGrpc());
builder.include(filter);
// Include only "Foo" service in Thrift.
DocServiceFilter filter = DocServiceFilter.ofThrift().and(DocServiceFilter.ofServiceName("com.example.Foo"));
builder.include(filter);
// Include all except annotated service and methods whose name is "bar".
DocServiceFilter filter = DocServiceFilter.ofAnnotated().or(DocServiceFilter.ofMethodName("bar"));
builder.exclude(filter);
| Modifier and Type | Method and Description |
|---|---|
default DocServiceFilter |
and(DocServiceFilter other)
Returns a composite
DocServiceFilter that represents a short-circuiting logical AND of
this filter and other. |
static DocServiceFilter |
ofAnnotated()
Returns a
DocServiceFilter which returns true only for the services detected by the
annotated service plugin. |
static DocServiceFilter |
ofGrpc()
Returns a
DocServiceFilter which returns true only for the services detected by the
gRPC plugin. |
static DocServiceFilter |
ofMethodName(String methodName)
Returns a
DocServiceFilter which returns true when the name of the method matches the
specified methodName. |
static DocServiceFilter |
ofMethodName(String serviceName,
String methodName)
Returns a
DocServiceFilter which returns true when the name of the service and method
matches the specified serviceName and methodName. |
static DocServiceFilter |
ofMethodName(String pluginName,
String serviceName,
String methodName)
Returns a
DocServiceFilter which returns true when the name of the plugin, service and
method matches the specified pluginName, serviceName and methodName. |
static DocServiceFilter |
ofPluginName(String pluginName)
Returns a
DocServiceFilter which returns true when the name of the plugin matches the
specified pluginName. |
static DocServiceFilter |
ofRegex(Pattern pattern)
Returns a
DocServiceFilter which returns true when the concatenated name of the plugin,
service and method matches the specified Pattern. |
static DocServiceFilter |
ofRegex(String regex)
Returns a
DocServiceFilter which returns true when the concatenated name of the plugin,
service and method matches the specified regex. |
static DocServiceFilter |
ofServiceName(String serviceName)
Returns a
DocServiceFilter which returns true when the name of the service matches the
specified serviceName. |
static DocServiceFilter |
ofServiceName(String pluginName,
String serviceName)
Returns a
DocServiceFilter which returns true when the name of the plugin and service
matches the specified pluginName and serviceName. |
static DocServiceFilter |
ofThrift()
Returns a
DocServiceFilter which returns true only for the services detected by the
Thrift plugin. |
default DocServiceFilter |
or(DocServiceFilter other)
Returns a composite
DocServiceFilter that represents a short-circuiting logical OR of
this filter and other. |
boolean |
test(String pluginName,
String serviceName,
String methodName)
|
static DocServiceFilter ofThrift()
DocServiceFilter which returns true only for the services detected by the
Thrift plugin.static DocServiceFilter ofGrpc()
DocServiceFilter which returns true only for the services detected by the
gRPC plugin.static DocServiceFilter ofAnnotated()
DocServiceFilter which returns true only for the services detected by the
annotated service plugin.static DocServiceFilter ofPluginName(String pluginName)
DocServiceFilter which returns true when the name of the plugin matches the
specified pluginName. For Thrift, gRPC and Annotated service, use ofThrift(),
ofGrpc() and ofAnnotated(), respectively.static DocServiceFilter ofServiceName(String serviceName)
DocServiceFilter which returns true when the name of the service matches the
specified serviceName.static DocServiceFilter ofServiceName(String pluginName, String serviceName)
DocServiceFilter which returns true when the name of the plugin and service
matches the specified pluginName and serviceName.static DocServiceFilter ofMethodName(String methodName)
DocServiceFilter which returns true when the name of the method matches the
specified methodName.static DocServiceFilter ofMethodName(String serviceName, String methodName)
DocServiceFilter which returns true when the name of the service and method
matches the specified serviceName and methodName.static DocServiceFilter ofMethodName(String pluginName, String serviceName, String methodName)
DocServiceFilter which returns true when the name of the plugin, service and
method matches the specified pluginName, serviceName and methodName.static DocServiceFilter ofRegex(String regex)
DocServiceFilter which returns true when the concatenated name of the plugin,
service and method matches the specified regex.
The concatenated name will be "pluginName + ':' + serviceName + '#' + methodName". For example:
grpc:com.example.grpc.FooService#EmptyCall // gRPC.
thrift:com.example.thrift.BarService#myMethod // Thrift.
annotated:com.example.annotated.BazService#myMethod // Annotated service.
static DocServiceFilter ofRegex(Pattern pattern)
DocServiceFilter which returns true when the concatenated name of the plugin,
service and method matches the specified Pattern.
The concatenated name will be "pluginName + ':' + serviceName + '#' + methodName". For example:
grpc:armeria.grpc.FooService#EmptyCall // gRPC.
thrift:com.linecorp.armeria.service.thrift.BarService#myMethod // Thrift.
annotated:com.linecorp.armeria.annotated.BazService#myMethod // Annotated service.
default DocServiceFilter or(DocServiceFilter other)
DocServiceFilter that represents a short-circuiting logical OR of
this filter and other. When evaluating the composite filter, if this filter returns true,
then the other filter is not evaluated.default DocServiceFilter and(DocServiceFilter other)
DocServiceFilter that represents a short-circuiting logical AND of
this filter and other. When evaluating the composite filter, if this filter returns
false, then the other filter is not evaluated.Copyright © 2020 LeanCloud. All rights reserved.