本文整理汇总了Java中org.apache.camel.util.ObjectHelper.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectHelper.isEmpty方法的具体用法?Java ObjectHelper.isEmpty怎么用?Java ObjectHelper.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.camel.util.ObjectHelper
的用法示例。
在下文中一共展示了ObjectHelper.isEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listObjects
import org.apache.camel.util.ObjectHelper; //导入方法依赖的package包/类
@Override
public ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws AmazonClientException, AmazonServiceException {
if ("nonExistingBucket".equals(listObjectsRequest.getBucketName()) && !nonExistingBucketCreated) {
AmazonServiceException ex = new AmazonServiceException("Unknown bucket");
ex.setStatusCode(404);
throw ex;
}
int capacity;
ObjectListing objectListing = new ObjectListing();
if (!ObjectHelper.isEmpty(listObjectsRequest.getMaxKeys()) && listObjectsRequest.getMaxKeys() != null) {
capacity = listObjectsRequest.getMaxKeys();
} else {
capacity = maxCapacity;
}
for (int index = 0; index < objects.size() && index < capacity; index++) {
S3ObjectSummary s3ObjectSummary = new S3ObjectSummary();
s3ObjectSummary.setBucketName(objects.get(index).getBucketName());
s3ObjectSummary.setKey(objects.get(index).getKey());
objectListing.getObjectSummaries().add(s3ObjectSummary);
}
return objectListing;
}
示例2: createEndpointUri
import org.apache.camel.util.ObjectHelper; //导入方法依赖的package包/类
@Override
public String createEndpointUri(String scheme, Map<String, String> options) throws URISyntaxException {
// FIXME: SpringBootAutoConfigurationMojo MUST not ignore connectorOptions
brokerUrl = options.remove("brokerUrl");
username = options.remove("username");
password = options.remove("password");
// validate url
if (ObjectHelper.isEmpty(this.brokerUrl)) {
throw new IllegalArgumentException("Missing required property brokerUrl");
}
// create ActiveMQ Connection Factory
ActiveMQConnectionFactory connectionFactory = ObjectHelper.isEmpty(username) ?
new ActiveMQConnectionFactory(this.brokerUrl) : new ActiveMQConnectionFactory(username, password, this.brokerUrl);
Sjms2Component delegate = getCamelContext().getComponent(getComponentName() + "-component", Sjms2Component.class);
delegate.setConnectionFactory(connectionFactory);
return super.createEndpointUri(scheme, options);
}
示例3: handle
import org.apache.camel.util.ObjectHelper; //导入方法依赖的package包/类
@Override
public Optional<ProcessorDefinition> handle(Function step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) {
final CamelContext context = routeBuilder.getContext();
final TypeConverter converter = context.getTypeConverter();
String method = null;
String function = step.getName();
String options = null;
if (ObjectHelper.isEmpty(function)) {
return Optional.empty();
}
int idx = function.indexOf("::");
if (idx > 0 && !function.endsWith("::")) {
method = function.substring(idx + 2);
function = function.substring(0, idx);
}
Map<String, Object> headers = step.getProperties();
if (ObjectHelper.isNotEmpty(headers)) {
options = headers.entrySet().stream()
.filter(entry -> Objects.nonNull(entry.getValue()))
.map(entry -> asBeanParameter(converter, entry))
.collect(Collectors.joining("&"));
}
String uri = "class:" + function;
if (method != null) {
uri += "?method=" + method;
if (options != null){
uri += "&" + options;
}
} else if (options != null){
uri += "?" + options;
}
return Optional.of(route.to(uri));
}
示例4: createEndpointUri
import org.apache.camel.util.ObjectHelper; //导入方法依赖的package包/类
@Override
public String createEndpointUri(String scheme, Map<String, String> options) throws URISyntaxException {
// validate url
if (ObjectHelper.isEmpty(this.brokerUrl)) {
throw new IllegalArgumentException("Missing required property brokerUrl");
}
// create ActiveMQ Connection Factory
final ActiveMQConnectionFactory connectionFactory = ActiveMQUtil.createActiveMQConnectionFactory(this.brokerUrl, username, this.password, this.brokerCertificate, clientCertificate, skipCertificateCheck);
SjmsComponent delegate = getCamelContext().getComponent(scheme, SjmsComponent.class);
delegate.setConnectionFactory(connectionFactory);
return super.createEndpointUri(scheme, options);
}
示例5: handle
import org.apache.camel.util.ObjectHelper; //导入方法依赖的package包/类
@Override
public ProcessorDefinition handle(Function step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) {
final CamelContext context = routeBuilder.getContext();
final TypeConverter converter = context.getTypeConverter();
String method = null;
String function = step.getName();
String options = null;
if (ObjectHelper.isEmpty(function)) {
return route;
}
int idx = function.indexOf("::");
if (idx > 0 && !function.endsWith("::")) {
method = function.substring(idx + 2);
function = function.substring(0, idx);
}
Map<String, Object> headers = step.getProperties();
if (ObjectHelper.isNotEmpty(headers)) {
options = headers.entrySet().stream()
.map(entry -> asBeanParameter(converter, entry))
.collect(Collectors.joining("&"));
}
String uri = "class:" + function;
if (method != null) {
uri += "?method=" + method;
if (options != null){
uri += "&" + options;
}
} else if (options != null){
uri += "?" + options;
}
return route.to(uri);
}