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.

@FunctionalInterface
public interface DocServiceFilter
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 Details

    • ofThrift

      static DocServiceFilter ofThrift()
      Returns a DocServiceFilter which returns true only for the services detected by the Thrift plugin.
    • ofGrpc

      static DocServiceFilter ofGrpc()
      Returns a DocServiceFilter which returns true only for the services detected by the gRPC plugin.
    • ofAnnotated

      static DocServiceFilter ofAnnotated()
      Returns a DocServiceFilter which returns true only for the services detected by the annotated service plugin.
    • ofPluginName

      static DocServiceFilter ofPluginName​(String pluginName)
      Returns a 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.
    • ofServiceName

      static DocServiceFilter ofServiceName​(String serviceName)
      Returns a DocServiceFilter which returns true when the name of the service matches the specified serviceName.
    • ofServiceName

      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.
    • ofMethodName

      static DocServiceFilter ofMethodName​(String methodName)
      Returns a DocServiceFilter which returns true when the name of the method matches the specified methodName.
    • ofMethodName

      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.
    • ofMethodName

      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.
    • ofRegex

      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. 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

      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. 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

      boolean test​(String pluginName, String serviceName, String methodName)
      Evaluates this DocServiceFilter on the specified pluginName, serviceName and methodName.
    • or

      default DocServiceFilter or​(DocServiceFilter other)
      Returns a composite 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.
    • and

      default DocServiceFilter and​(DocServiceFilter other)
      Returns a composite 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.