Record Class GrpcServiceInfo
java.lang.Object
java.lang.Record
org.springframework.grpc.server.service.GrpcServiceInfo
- Record Components:
interceptors- list ofServerInterceptorbean types to be applied to the serviceinterceptorNames- list ofServerInterceptorbean names to be applied to the serviceblendWithGlobalInterceptors- whether the service specific interceptors should be merged and sorted (blended) with the global interceptors
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcServiceInfo(Class<? extends io.grpc.ServerInterceptor>[] interceptors, String[] interceptorNames, boolean blendWithGlobalInterceptors) Creates an instance of aGrpcServiceInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theblendWithGlobalInterceptorsrecord component.final booleanIndicates whether some other object is "equal to" this one.static @Nullable GrpcServiceInfofrom(@Nullable GrpcService grpcService) Construct a service info from aGrpcServiceannotation.final inthashCode()Returns a hash code value for this object.String[]Returns the value of theinterceptorNamesrecord component.Class<? extends io.grpc.ServerInterceptor>[]Returns the value of theinterceptorsrecord component.final StringtoString()Returns a string representation of this record class.static GrpcServiceInfowithInterceptorNames(List<String> interceptorNames) Construct a service info with the specified interceptors names.static GrpcServiceInfowithInterceptors(List<Class<? extends io.grpc.ServerInterceptor>> interceptors) Construct a service info with the specified interceptors.
-
Constructor Details
-
GrpcServiceInfo
public GrpcServiceInfo(Class<? extends io.grpc.ServerInterceptor>[] interceptors, String[] interceptorNames, boolean blendWithGlobalInterceptors) Creates an instance of aGrpcServiceInforecord class.- Parameters:
interceptors- the value for theinterceptorsrecord componentinterceptorNames- the value for theinterceptorNamesrecord componentblendWithGlobalInterceptors- the value for theblendWithGlobalInterceptorsrecord component
-
-
Method Details
-
from
Construct a service info from aGrpcServiceannotation.- Parameters:
grpcService- the service annotation- Returns:
- the service info or null if the supplied annotation is null
-
withInterceptors
public static GrpcServiceInfo withInterceptors(List<Class<? extends io.grpc.ServerInterceptor>> interceptors) Construct a service info with the specified interceptors.- Parameters:
interceptors- non-null list of interceptor bean types- Returns:
- the service info with the supplied interceptors
-
withInterceptorNames
Construct a service info with the specified interceptors names.- Parameters:
interceptorNames- non-null list of interceptor bean names- Returns:
- the service info with the supplied interceptors names
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
interceptors
Returns the value of theinterceptorsrecord component.- Returns:
- the value of the
interceptorsrecord component
-
interceptorNames
Returns the value of theinterceptorNamesrecord component.- Returns:
- the value of the
interceptorNamesrecord component
-
blendWithGlobalInterceptors
public boolean blendWithGlobalInterceptors()Returns the value of theblendWithGlobalInterceptorsrecord component.- Returns:
- the value of the
blendWithGlobalInterceptorsrecord component
-