Package com.linecorp.armeria.server.docs
Interface DocServiceFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A filter which includes or excludes service methods when building a
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);
-
Method Summary
Modifier and TypeMethodDescriptiondefault DocServiceFilter
and
(DocServiceFilter other) Returns a compositeDocServiceFilter
that represents a short-circuiting logicalAND
of this filter andother
.static DocServiceFilter
Returns aDocServiceFilter
which returnstrue
only for the services detected by the annotated service plugin.static DocServiceFilter
Returns aDocServiceFilter
which returnstrue
only for the services detected by the graphql service plugin.static DocServiceFilter
ofGrpc()
Returns aDocServiceFilter
which returnstrue
only for the services detected by the gRPC plugin.static DocServiceFilter
ofMethodName
(String methodName) Returns aDocServiceFilter
which returnstrue
when the name of the method matches the specifiedmethodName
.static DocServiceFilter
ofMethodName
(String serviceName, String methodName) Returns aDocServiceFilter
which returnstrue
when the name of the service and method matches the specifiedserviceName
andmethodName
.static DocServiceFilter
ofMethodName
(String pluginName, String serviceName, String methodName) Returns aDocServiceFilter
which returnstrue
when the name of the plugin, service and method matches the specifiedpluginName
,serviceName
andmethodName
.static DocServiceFilter
ofPluginName
(String pluginName) Returns aDocServiceFilter
which returnstrue
when the name of the plugin matches the specifiedpluginName
.static DocServiceFilter
Returns aDocServiceFilter
which returnstrue
when the concatenated name of the plugin, service and method matches the specifiedregex
.static DocServiceFilter
Returns aDocServiceFilter
which returnstrue
when the concatenated name of the plugin, service and method matches the specifiedPattern
.static DocServiceFilter
ofServiceName
(String serviceName) Returns aDocServiceFilter
which returnstrue
when the name of the service matches the specifiedserviceName
.static DocServiceFilter
ofServiceName
(String pluginName, String serviceName) Returns aDocServiceFilter
which returnstrue
when the name of the plugin and service matches the specifiedpluginName
andserviceName
.static DocServiceFilter
ofThrift()
Returns aDocServiceFilter
which returnstrue
only for the services detected by the Thrift plugin.default DocServiceFilter
or
(DocServiceFilter other) Returns a compositeDocServiceFilter
that represents a short-circuiting logicalOR
of this filter andother
.boolean
-
Method Details
-
ofThrift
Returns aDocServiceFilter
which returnstrue
only for the services detected by the Thrift plugin. -
ofGrpc
Returns aDocServiceFilter
which returnstrue
only for the services detected by the gRPC plugin. -
ofAnnotated
Returns aDocServiceFilter
which returnstrue
only for the services detected by the annotated service plugin. -
ofGraphql
Returns aDocServiceFilter
which returnstrue
only for the services detected by the graphql service plugin. -
ofPluginName
Returns aDocServiceFilter
which returnstrue
when the name of the plugin matches the specifiedpluginName
. For Thrift, gRPC and Annotated service, useofThrift()
,ofGrpc()
andofAnnotated()
, respectively. -
ofServiceName
Returns aDocServiceFilter
which returnstrue
when the name of the service matches the specifiedserviceName
. -
ofServiceName
Returns aDocServiceFilter
which returnstrue
when the name of the plugin and service matches the specifiedpluginName
andserviceName
. -
ofMethodName
Returns aDocServiceFilter
which returnstrue
when the name of the method matches the specifiedmethodName
. -
ofMethodName
Returns aDocServiceFilter
which returnstrue
when the name of the service and method matches the specifiedserviceName
andmethodName
. -
ofMethodName
Returns aDocServiceFilter
which returnstrue
when the name of the plugin, service and method matches the specifiedpluginName
,serviceName
andmethodName
. -
ofRegex
Returns aDocServiceFilter
which returnstrue
when the concatenated name of the plugin, service and method matches the specifiedregex
. 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.
-
ofRegex
Returns aDocServiceFilter
which returnstrue
when the concatenated name of the plugin, service and method matches the specifiedPattern
. 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.
-
test
-
or
Returns a compositeDocServiceFilter
that represents a short-circuiting logicalOR
of this filter andother
. When evaluating the composite filter, if this filter returnstrue
, then theother
filter is not evaluated. -
and
Returns a compositeDocServiceFilter
that represents a short-circuiting logicalAND
of this filter andother
. When evaluating the composite filter, if this filter returnsfalse
, then theother
filter is not evaluated.
-