本文整理了Java中feign.Util.checkNotNull()
方法的一些代码示例,展示了Util.checkNotNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.checkNotNull()
方法的具体详情如下:
包路径:feign.Util
类名称:Util
方法名:checkNotNull
[英]Copy of com.google.common.base.Preconditions#checkNotNull.
[中]com的副本。谷歌。常见的基础先决条件#checkNotNull。
代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba
SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch");
}
代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba
SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
FallbackFactory fallbackFactory) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch");
this.fallbackFactory = fallbackFactory;
this.fallbackMethodMap = toFallbackMethod(dispatch);
}
代码示例来源:origin: resilience4j/resilience4j
public DecoratorInvocationHandler(Target<?> target,
Map<Method, MethodHandler> dispatch,
FeignDecorator invocationDecorator) {
this.target = checkNotNull(target, "target");
checkNotNull(dispatch, "dispatch");
this.decoratedDispatch = decorateMethodHandlers(dispatch, invocationDecorator, target);
}
代码示例来源:origin: com.netflix.feign/feign-core
/**
* @param message possibly null reason for the failure.
* @param cause the cause of the error.
*/
public DecodeException(String message, Throwable cause) {
super(message, checkNotNull(cause, "cause"));
}
}
代码示例来源:origin: com.netflix.feign/feign-core
Request(String method, String url, Map<String, Collection<String>> headers, byte[] body,
Charset charset) {
this.method = checkNotNull(method, "method of %s", url);
this.url = checkNotNull(url, "url");
this.headers = checkNotNull(headers, "headers of %s %s", method, url);
this.body = body; // nullable
this.charset = charset; // nullable
}
代码示例来源:origin: com.netflix.feign/feign-core
/**
* @param message the reason for the failure.
*/
public DecodeException(String message) {
super(checkNotNull(message, "message"));
}
代码示例来源:origin: com.netflix.feign/feign-core
Factory(Client client, Retryer retryer, List<RequestInterceptor> requestInterceptors,
Logger logger, Logger.Level logLevel, boolean decode404) {
this.client = checkNotNull(client, "client");
this.retryer = checkNotNull(retryer, "retryer");
this.requestInterceptors = checkNotNull(requestInterceptors, "requestInterceptors");
this.logger = checkNotNull(logger, "logger");
this.logLevel = checkNotNull(logLevel, "logLevel");
this.decode404 = decode404;
}
代码示例来源:origin: com.netflix.feign/feign-core
/**
* @param message the reason for the failure.
*/
public EncodeException(String message) {
super(checkNotNull(message, "message"));
}
代码示例来源:origin: io.github.reactivefeign/feign-reactive-core
/**
* No parameters can be null except {@code body}. All parameters must be effectively
* immutable, via safe copies, not mutating or otherwise.
*/
public ReactiveHttpRequest(HttpMethod method, URI uri,
MultiValueMap<String, String> headers, Publisher<Object> body) {
this.method = checkNotNull(method, "method of %s", uri);
this.uri = checkNotNull(uri, "url");
this.headers = checkNotNull(headers, "headers of %s %s", method, uri);
this.body = body; // nullable
}
代码示例来源:origin: io.github.reactivefeign/feign-reactive-core
private ReactiveInvocationHandler(final Target<?> target,
final Map<Method, MethodHandler> dispatch) {
this.target = checkNotNull(target, "target must not be null");
this.dispatch = checkNotNull(dispatch, "dispatch must not be null");
}
代码示例来源:origin: com.netflix.feign/feign-core
ParseHandlersByName(Contract contract, Options options, Encoder encoder, Decoder decoder,
ErrorDecoder errorDecoder, SynchronousMethodHandler.Factory factory) {
this.contract = contract;
this.options = options;
this.factory = factory;
this.errorDecoder = errorDecoder;
this.encoder = checkNotNull(encoder, "encoder");
this.decoder = checkNotNull(decoder, "decoder");
}
代码示例来源:origin: com.playtika.reactivefeign/feign-reactor-cloud
public HystrixMethodHandlerFactory(MethodHandlerFactory methodHandlerFactory,
CloudReactiveFeign.SetterFactory commandSetterFactory,
@Nullable Function<Throwable, Object> fallbackFactory) {
this.methodHandlerFactory = checkNotNull(methodHandlerFactory, "methodHandlerFactory must not be null");
this.commandSetterFactory = checkNotNull(commandSetterFactory, "hystrixObservableCommandSetter must not be null");
this.fallbackFactory = fallbackFactory;
}
代码示例来源:origin: io.github.reactivefeign/feign-reactive-cloud
public Factory(ReactiveMethodHandlerFactory methodHandlerFactory,
CloudReactiveFeign.SetterFactory commandSetterFactory,
@Nullable
Function<Throwable, Object> fallbackFactory) {
this.methodHandlerFactory = checkNotNull(methodHandlerFactory, "methodHandlerFactory must not be null");
this.commandSetterFactory = checkNotNull(commandSetterFactory, "hystrixObservableCommandSetter must not be null");
this.fallbackFactory = fallbackFactory;
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-alibaba-sentinel
SentinelInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
FallbackFactory fallbackFactory) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch");
this.fallbackFactory = fallbackFactory;
this.fallbackMethodMap = toFallbackMethod(dispatch);
}
代码示例来源:origin: kptfh/feign-reactive
private ReactiveInvocationHandler(final Target<?> target,
final Map<Method, MethodHandler> dispatch) {
this.target = checkNotNull(target, "target must not be null");
this.dispatch = checkNotNull(dispatch, "dispatch must not be null");
defineObjectMethodsHandlers();
}
代码示例来源:origin: com.netflix.feign/feign-core
public RequestTemplate(RequestTemplate toCopy) {
checkNotNull(toCopy, "toCopy");
this.method = toCopy.method;
this.url.append(toCopy.url);
this.queries.putAll(toCopy.queries);
this.headers.putAll(toCopy.headers);
this.charset = toCopy.charset;
this.body = toCopy.body;
this.bodyTemplate = toCopy.bodyTemplate;
this.decodeSlash = toCopy.decodeSlash;
}
代码示例来源:origin: com.netflix.feign/feign-core
public HardCodedTarget(Class<T> type, String name, String url) {
this.type = checkNotNull(type, "type");
this.name = checkNotNull(emptyToNull(name), "name");
this.url = checkNotNull(emptyToNull(url), "url");
}
代码示例来源:origin: com.netflix.feign/feign-core
public RequestTemplate method(String method) {
this.method = checkNotNull(method, "method");
checkArgument(method.matches("^[A-Z]+$"), "Invalid HTTP Method: %s", method);
return this;
}
代码示例来源:origin: com.netflix.feign/feign-core
private static Body orNull(String text, Charset charset) {
if (text == null) {
return null;
}
checkNotNull(charset, "charset");
return new ByteArrayBody(text.getBytes(charset));
}
代码示例来源:origin: io.github.reactivefeign/feign-reactive-core
protected ReactiveFeign build() {
checkNotNull(this.webClient,
"WebClient instance wasn't provided in ReactiveFeign builder");
final ParseHandlersByName handlersByName = new ParseHandlersByName(contract,
buildReactiveMethodHandlerFactory());
return new ReactiveFeign(handlersByName, invocationHandlerFactory);
}
内容来源于网络,如有侵权,请联系作者删除!