feign.Util.checkNotNull()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中feign.Util.checkNotNull()方法的一些代码示例,展示了Util.checkNotNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.checkNotNull()方法的具体详情如下:
包路径:feign.Util
类名称:Util
方法名:checkNotNull

Util.checkNotNull介绍

[英]Copy of com.google.common.base.Preconditions#checkNotNull.
[中]com的副本。谷歌。常见的基础先决条件#checkNotNull。

代码示例

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

  1. SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch) {
  2. this.target = checkNotNull(target, "target");
  3. this.dispatch = checkNotNull(dispatch, "dispatch");
  4. }

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

  1. SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
  2. FallbackFactory fallbackFactory) {
  3. this.target = checkNotNull(target, "target");
  4. this.dispatch = checkNotNull(dispatch, "dispatch");
  5. this.fallbackFactory = fallbackFactory;
  6. this.fallbackMethodMap = toFallbackMethod(dispatch);
  7. }

代码示例来源:origin: resilience4j/resilience4j

  1. public DecoratorInvocationHandler(Target<?> target,
  2. Map<Method, MethodHandler> dispatch,
  3. FeignDecorator invocationDecorator) {
  4. this.target = checkNotNull(target, "target");
  5. checkNotNull(dispatch, "dispatch");
  6. this.decoratedDispatch = decorateMethodHandlers(dispatch, invocationDecorator, target);
  7. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. /**
  2. * @param message possibly null reason for the failure.
  3. * @param cause the cause of the error.
  4. */
  5. public DecodeException(String message, Throwable cause) {
  6. super(message, checkNotNull(cause, "cause"));
  7. }
  8. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. Request(String method, String url, Map<String, Collection<String>> headers, byte[] body,
  2. Charset charset) {
  3. this.method = checkNotNull(method, "method of %s", url);
  4. this.url = checkNotNull(url, "url");
  5. this.headers = checkNotNull(headers, "headers of %s %s", method, url);
  6. this.body = body; // nullable
  7. this.charset = charset; // nullable
  8. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. /**
  2. * @param message the reason for the failure.
  3. */
  4. public DecodeException(String message) {
  5. super(checkNotNull(message, "message"));
  6. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. Factory(Client client, Retryer retryer, List<RequestInterceptor> requestInterceptors,
  2. Logger logger, Logger.Level logLevel, boolean decode404) {
  3. this.client = checkNotNull(client, "client");
  4. this.retryer = checkNotNull(retryer, "retryer");
  5. this.requestInterceptors = checkNotNull(requestInterceptors, "requestInterceptors");
  6. this.logger = checkNotNull(logger, "logger");
  7. this.logLevel = checkNotNull(logLevel, "logLevel");
  8. this.decode404 = decode404;
  9. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. /**
  2. * @param message the reason for the failure.
  3. */
  4. public EncodeException(String message) {
  5. super(checkNotNull(message, "message"));
  6. }

代码示例来源:origin: io.github.reactivefeign/feign-reactive-core

  1. /**
  2. * No parameters can be null except {@code body}. All parameters must be effectively
  3. * immutable, via safe copies, not mutating or otherwise.
  4. */
  5. public ReactiveHttpRequest(HttpMethod method, URI uri,
  6. MultiValueMap<String, String> headers, Publisher<Object> body) {
  7. this.method = checkNotNull(method, "method of %s", uri);
  8. this.uri = checkNotNull(uri, "url");
  9. this.headers = checkNotNull(headers, "headers of %s %s", method, uri);
  10. this.body = body; // nullable
  11. }

代码示例来源:origin: io.github.reactivefeign/feign-reactive-core

  1. private ReactiveInvocationHandler(final Target<?> target,
  2. final Map<Method, MethodHandler> dispatch) {
  3. this.target = checkNotNull(target, "target must not be null");
  4. this.dispatch = checkNotNull(dispatch, "dispatch must not be null");
  5. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. ParseHandlersByName(Contract contract, Options options, Encoder encoder, Decoder decoder,
  2. ErrorDecoder errorDecoder, SynchronousMethodHandler.Factory factory) {
  3. this.contract = contract;
  4. this.options = options;
  5. this.factory = factory;
  6. this.errorDecoder = errorDecoder;
  7. this.encoder = checkNotNull(encoder, "encoder");
  8. this.decoder = checkNotNull(decoder, "decoder");
  9. }

代码示例来源:origin: com.playtika.reactivefeign/feign-reactor-cloud

  1. public HystrixMethodHandlerFactory(MethodHandlerFactory methodHandlerFactory,
  2. CloudReactiveFeign.SetterFactory commandSetterFactory,
  3. @Nullable Function<Throwable, Object> fallbackFactory) {
  4. this.methodHandlerFactory = checkNotNull(methodHandlerFactory, "methodHandlerFactory must not be null");
  5. this.commandSetterFactory = checkNotNull(commandSetterFactory, "hystrixObservableCommandSetter must not be null");
  6. this.fallbackFactory = fallbackFactory;
  7. }

代码示例来源:origin: io.github.reactivefeign/feign-reactive-cloud

  1. public Factory(ReactiveMethodHandlerFactory methodHandlerFactory,
  2. CloudReactiveFeign.SetterFactory commandSetterFactory,
  3. @Nullable
  4. Function<Throwable, Object> fallbackFactory) {
  5. this.methodHandlerFactory = checkNotNull(methodHandlerFactory, "methodHandlerFactory must not be null");
  6. this.commandSetterFactory = checkNotNull(commandSetterFactory, "hystrixObservableCommandSetter must not be null");
  7. this.fallbackFactory = fallbackFactory;
  8. }

代码示例来源:origin: org.springframework.cloud/spring-cloud-alibaba-sentinel

  1. SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
  2. FallbackFactory fallbackFactory) {
  3. this.target = checkNotNull(target, "target");
  4. this.dispatch = checkNotNull(dispatch, "dispatch");
  5. this.fallbackFactory = fallbackFactory;
  6. this.fallbackMethodMap = toFallbackMethod(dispatch);
  7. }

代码示例来源:origin: kptfh/feign-reactive

  1. private ReactiveInvocationHandler(final Target<?> target,
  2. final Map<Method, MethodHandler> dispatch) {
  3. this.target = checkNotNull(target, "target must not be null");
  4. this.dispatch = checkNotNull(dispatch, "dispatch must not be null");
  5. defineObjectMethodsHandlers();
  6. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. public RequestTemplate(RequestTemplate toCopy) {
  2. checkNotNull(toCopy, "toCopy");
  3. this.method = toCopy.method;
  4. this.url.append(toCopy.url);
  5. this.queries.putAll(toCopy.queries);
  6. this.headers.putAll(toCopy.headers);
  7. this.charset = toCopy.charset;
  8. this.body = toCopy.body;
  9. this.bodyTemplate = toCopy.bodyTemplate;
  10. this.decodeSlash = toCopy.decodeSlash;
  11. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. public HardCodedTarget(Class<T> type, String name, String url) {
  2. this.type = checkNotNull(type, "type");
  3. this.name = checkNotNull(emptyToNull(name), "name");
  4. this.url = checkNotNull(emptyToNull(url), "url");
  5. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. public RequestTemplate method(String method) {
  2. this.method = checkNotNull(method, "method");
  3. checkArgument(method.matches("^[A-Z]+$"), "Invalid HTTP Method: %s", method);
  4. return this;
  5. }

代码示例来源:origin: com.netflix.feign/feign-core

  1. private static Body orNull(String text, Charset charset) {
  2. if (text == null) {
  3. return null;
  4. }
  5. checkNotNull(charset, "charset");
  6. return new ByteArrayBody(text.getBytes(charset));
  7. }

代码示例来源:origin: io.github.reactivefeign/feign-reactive-core

  1. protected ReactiveFeign build() {
  2. checkNotNull(this.webClient,
  3. "WebClient instance wasn't provided in ReactiveFeign builder");
  4. final ParseHandlersByName handlersByName = new ParseHandlersByName(contract,
  5. buildReactiveMethodHandlerFactory());
  6. return new ReactiveFeign(handlersByName, invocationHandlerFactory);
  7. }

相关文章