本文整理了Java中org.mule.runtime.api.util.Preconditions.checkNotNull()
方法的一些代码示例,展示了Preconditions.checkNotNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preconditions.checkNotNull()
方法的具体详情如下:
包路径:org.mule.runtime.api.util.Preconditions
类名称:Preconditions
方法名:checkNotNull
暂无
代码示例来源:origin: mulesoft/mule
/**
* Creates a new instance.
*
* @param serviceArtifactClassLoaders {@link List} of {@link ArtifactClassLoader}s created for services discovered
* during classification process. The {@code artifactName} of each {@link ArtifactClassLoader} represents the
* {@value AetherClassPathClassifier#SERVICE_PROVIDER_CLASS_NAME} defined by the service in its
* {@value AetherClassPathClassifier##SERVICE_PROPERTIES_FILE_NAME}and it is used for instantiating the {@link ServiceProvider}.
*/
public IsolatedServiceProviderDiscoverer(final List<ArtifactClassLoader> serviceArtifactClassLoaders) {
checkNotNull(serviceArtifactClassLoaders, "serviceArtifactClassLoaders cannot be null");
this.serviceArtifactClassLoaders = serviceArtifactClassLoaders;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an instance of the manager.
*
* @param containerClassLoader {@link ClassLoader} from the container.
*/
public MuleExtensionModelLoaderManager(ArtifactClassLoader containerClassLoader) {
checkNotNull(containerClassLoader, "containerClassLoader cannot be null");
this.containerClassLoader = containerClassLoader;
}
代码示例来源:origin: mulesoft/mule
public ByteArrayHttpEntity(byte[] content) {
checkNotNull(content, "HTTP entity content cannot be null.");
this.content = content;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an instance of the configuration builder.
*
* @param artifactPlugins {@link List} of {@link ArtifactPlugin ArtifactPlugins} to be registered.
* @param extensionManagerFactory creates the extension manager for this artifact. Non null.
*/
public ArtifactExtensionManagerConfigurationBuilder(List<ArtifactPlugin> artifactPlugins,
ExtensionManagerFactory extensionManagerFactory) {
checkNotNull(artifactPlugins, "artifactPlugins cannot be null");
checkNotNull(extensionManagerFactory, "extensionManagerFactory cannot be null");
this.artifactPlugins = artifactPlugins;
this.extensionManagerFactory = extensionManagerFactory;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an instance of this resolver.
*
* @param dependencyResolver {@link DependencyResolver} to get artifact output. Non null.
*/
public ArtifactClassificationTypeResolver(DependencyResolver dependencyResolver) {
checkNotNull(dependencyResolver, "dependencyResolver cannot be null");
this.dependencyResolver = dependencyResolver;
}
代码示例来源:origin: mulesoft/mule
/**
* @param entity the {@link HttpEntity} that should be used as body for the {@link HttpMessage}. Non null.
* @return this builder
*/
public B entity(HttpEntity entity) {
checkNotNull(entity, "entity cannot be null, use an EmptyHttpEntity instead");
this.entity = entity;
return (B) this;
}
代码示例来源:origin: mulesoft/mule
public ConfigurationPropertiesException(I18nMessage message, Component component) {
super(message);
checkNotNull(component, "component cannot be null");
this.component = component;
}
代码示例来源:origin: mulesoft/mule
public ConfigurationPropertiesException(I18nMessage message, Component component, Exception e) {
super(message, e);
checkNotNull(component, "component cannot be null");
this.component = component;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates and instance of the workspace reader for the given classPath and workspaceLocationResolver.
*
* @param classPath {@link URL}s to find the artifact's {@link URL}
* @param workspaceLocationResolver {@link WorkspaceLocationResolver} to retrieve the workspace reference for a given
* {@link Artifact}
*/
public DefaultWorkspaceReader(List<URL> classPath, WorkspaceLocationResolver workspaceLocationResolver) {
checkNotNull(classPath, "classPath cannot be null");
checkNotNull(workspaceLocationResolver, "workspaceLocationResolver cannot be null");
this.classPath = classPath;
this.workspaceLocationResolver = workspaceLocationResolver;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an instance of the classification.
*
* @param name a {@link String} representing the name of the artifact. Not null.
* @param urls list of {@link URL}s that would be used to create the {@link java.net.URLClassLoader}. Not null.
*/
public ArtifactUrlClassification(String artifactId, String name, List<URL> urls) {
checkNotNull(artifactId, "artifactId cannot be null");
checkNotNull(name, "name cannot be null");
checkNotNull(urls, "urls cannot be null");
this.artifactId = artifactId;
this.name = name;
this.urls = urls;
}
代码示例来源:origin: mulesoft/mule
/**
* @return a {@link HttpServerConfiguration} as specified.
*/
public HttpServerConfiguration build() {
checkNotNull(host, "A host is mandatory");
checkNotNull(port, "Port is mandatory");
checkNotNull(name, "Name is mandatory");
return new HttpServerConfiguration(host, port, tlsContextFactory, usePersistentConnections, connectionIdleTimeout,
name, schedulerSupplier);
}
}
代码示例来源:origin: mulesoft/mule
/**
* @param licenseModel the license requirements for this plugin.
*/
public void setLicenseModel(LicenseModel licenseModel) {
Preconditions.checkNotNull(licenseModel, "licenseModel cannot be null");
this.licenseModel = of(licenseModel);
}
}
代码示例来源:origin: mulesoft/mule
/**
* @return a new {@link SoapClientConfiguration} instance with the attributes specified.
*/
public SoapClientConfiguration build() {
checkNotNull(wsdlLocation, "WSDL location cannot be null");
checkNotNull(service, "Service cannot be null");
checkNotNull(port, "Port cannot be null");
return new SoapClientConfiguration(wsdlLocation, address, service, port, version, mtomEnabled, securities,
dispatcher, locator, encoding);
}
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an instance of the classifier.
*
* @param dependencyResolver {@link DependencyResolver} to resolve dependencies. Non null.
* @param artifactClassificationTypeResolver {@link ArtifactClassificationTypeResolver} to identify rootArtifact type. Non null.
*/
public AetherClassPathClassifier(DependencyResolver dependencyResolver,
ArtifactClassificationTypeResolver artifactClassificationTypeResolver) {
checkNotNull(dependencyResolver, "dependencyResolver cannot be null");
checkNotNull(artifactClassificationTypeResolver, "artifactClassificationTypeResolver cannot be null");
this.dependencyResolver = dependencyResolver;
this.artifactClassificationTypeResolver = artifactClassificationTypeResolver;
muleVersion = getMuleVersion();
}
代码示例来源:origin: mulesoft/mule
public ImmutableSoapRequest build() {
checkNotNull(operation, "Missing executing operation");
return new ImmutableSoapRequest(content,
soapHeaders.build(),
transportHeaders.build(),
attachments.build(),
contentType,
operation);
}
}
代码示例来源:origin: mulesoft/mule
/**
* @return an {@link HttpClientConfiguration} as specified.
*/
public HttpClientConfiguration build() {
checkNotNull(name, "Name is mandatory.");
return new HttpClientConfiguration(tlsContextFactory, proxyConfig, clientSocketProperties, maxConnections, decompress,
usePersistentConnections, connectionIdleTimeout, streaming, responseBufferSize, name);
}
}
代码示例来源:origin: mulesoft/mule
/**
* Creates an extended {@link ClassLoaderFilter} to exporte classes that are not exported as packages in the original filter.
*
* @param classLoaderFilter the original filter. Not null.
* @param exportedClasses a {@link List} of {@link Class}es to export in addition to the original filter. Not null.
*/
public TestArtifactClassLoaderFilter(final ArtifactClassLoaderFilter classLoaderFilter, final List<Class> exportedClasses) {
checkNotNull(classLoaderFilter, "classLoaderFilter cannot be null");
checkNotNull(exportedClasses, "exportedClasses cannot be null");
this.classLoaderFilter = classLoaderFilter;
this.exportedClasses = exportedClasses.stream().collect(Collectors.toMap(Class::getName, identity()));
exportedPackages = new HashSet<>(classLoaderFilter.getExportedClassPackages());
exportedPackages.addAll(exportedClasses.stream().map(clazz -> getPackageName(clazz.getName())).collect(Collectors.toList()));
}
代码示例来源:origin: mulesoft/mule
/**
* Resolves direct dependencies for an {@link Artifact}.
*
* @param artifact {@link Artifact} to collect its direct dependencies
* @param remoteRepositories remote repositories to be used in addition to the one in context
* @return a {@link List} of {@link Dependency} for each direct dependency resolved
* @throws {@link ArtifactDescriptorException} if the artifact descriptor could not be read
*/
public List<Dependency> getDirectDependencies(Artifact artifact, List<RemoteRepository> remoteRepositories)
throws ArtifactDescriptorException {
checkNotNull(artifact, "artifact cannot be null");
return readArtifactDescriptor(artifact, remoteRepositories).getDependencies();
}
代码示例来源:origin: mulesoft/mule
/**
* Resolves direct dependencies for an {@link Artifact}.
*
* @param artifact {@link Artifact} to collect its direct dependencies
* @return a {@link List} of {@link Dependency} for each direct dependency resolved
* @throws {@link ArtifactDescriptorException} if the artifact descriptor could not be read
*/
public List<Dependency> getDirectDependencies(Artifact artifact) throws ArtifactDescriptorException {
checkNotNull(artifact, "artifact cannot be null");
return readArtifactDescriptor(artifact).getDependencies();
}
代码示例来源:origin: mulesoft/mule
/**
* Resolves the path for an artifact.
*
* @param artifact the {@link Artifact} requested, must not be {@code null}
* @return The resolution result, never {@code null}.
* @throws {@link ArtifactResolutionException} if the artifact could not be resolved.
*/
public ArtifactResult resolveArtifact(Artifact artifact) throws ArtifactResolutionException {
checkNotNull(artifact, "artifact cannot be null");
final ArtifactRequest request = new ArtifactRequest(artifact, resolutionContext.getRemoteRepositories(), null);
return repositoryState.getSystem().resolveArtifact(repositoryState.getSession(), request);
}
内容来源于网络,如有侵权,请联系作者删除!