org.lognet.springboot.grpc.GRpcServicesRegistry Maven / Gradle / Ivy
The newest version!
// Generated by delombok at Wed Sep 27 05:27:18 UTC 2023
package org.lognet.springboot.grpc;
import io.grpc.BindableService;
import io.grpc.MethodDescriptor;
import io.grpc.ServerInterceptor;
import io.grpc.ServerServiceDefinition;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.MethodIntrospector;
import org.springframework.core.MethodParameter;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.function.SingletonSupplier;
public class GRpcServicesRegistry implements InitializingBean, ApplicationContextAware {
public static class GrpcServiceMethod {
private BindableService service;
private Method method;
@java.lang.SuppressWarnings("all")
GrpcServiceMethod(final BindableService service, final Method method) {
this.service = service;
this.method = method;
}
@java.lang.SuppressWarnings("all")
public static class GrpcServiceMethodBuilder {
@java.lang.SuppressWarnings("all")
private BindableService service;
@java.lang.SuppressWarnings("all")
private Method method;
@java.lang.SuppressWarnings("all")
GrpcServiceMethodBuilder() {}
/**
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public GRpcServicesRegistry.GrpcServiceMethod.GrpcServiceMethodBuilder service(
final BindableService service) {
this.service = service;
return this;
}
/**
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public GRpcServicesRegistry.GrpcServiceMethod.GrpcServiceMethodBuilder method(
final Method method) {
this.method = method;
return this;
}
@java.lang.SuppressWarnings("all")
public GRpcServicesRegistry.GrpcServiceMethod build() {
return new GRpcServicesRegistry.GrpcServiceMethod(this.service, this.method);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "GRpcServicesRegistry.GrpcServiceMethod.GrpcServiceMethodBuilder(service="
+ this.service
+ ", method="
+ this.method
+ ")";
}
}
@java.lang.SuppressWarnings("all")
public static GRpcServicesRegistry.GrpcServiceMethod.GrpcServiceMethodBuilder builder() {
return new GRpcServicesRegistry.GrpcServiceMethod.GrpcServiceMethodBuilder();
}
@java.lang.SuppressWarnings("all")
public BindableService getService() {
return this.service;
}
@java.lang.SuppressWarnings("all")
public Method getMethod() {
return this.method;
}
}
private ApplicationContext applicationContext;
private Supplier