Java 类com.amazonaws.util.CollectionUtils 实例源码

项目:ibm-cos-sdk-java    文件:AmazonHttpClient.java   
/**
 * Merge query parameters into the given request.
 */
private void mergeQueryParameters(Map<String, List<String>> params) {
    Map<String, List<String>> existingParams = request.getParameters();
    for (Entry<String, List<String>> param : params.entrySet()) {
        String pName = param.getKey();
        List<String> pValues = param.getValue();
        existingParams.put(pName, CollectionUtils.mergeLists(existingParams.get(pName), pValues));
    }
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
private void addInventoryOptionalFields(XmlWriter xml, List<String> optionalFields) {
    if (CollectionUtils.isNullOrEmpty(optionalFields)) {
        return;
    }

    xml.start("OptionalFields");
    for (String field : optionalFields) {
        xml.start("Field").value(field).end();
    }
    xml.end();
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
/**
 * If S3Key filter is set make sure it has at least one rule
 */
private void validateS3KeyFilter(S3KeyFilter s3KeyFilter) {
    if (CollectionUtils.isNullOrEmpty(s3KeyFilter.getFilterRules())) {
        throw new SdkClientException("Cannot have an S3KeyFilter without any filter rules");
    }
}
项目:aws-lambda-jenkins-plugin    文件:DeployConfig.java   
public List<String> getSubnets() {
    return CollectionUtils.isNullOrEmpty(subnets) ? new ArrayList<String>() : subnets;
}
项目:aws-lambda-jenkins-plugin    文件:DeployConfig.java   
public List<String> getSecurityGroups() {
    return CollectionUtils.isNullOrEmpty(securityGroups) ? new ArrayList<String>() : securityGroups;
}
项目:aws-cloudtrail-processing-library    文件:SourceSerializerChain.java   
/**
 * Constructs a new <code>SourceSerializerChain</code> with the specified source serializers.
 * <p>
 * Use {@link SourceSerializerFactory#createSourceSerializerChain()} for default construction.
 * </p>
 * <p>
 * When source are required from this serializer, it will call each of these source serializers in the same order
 * specified here until one of them return {@link CloudTrailSource}.
 * </p>
 *
 * @param sourceSerializers A list of at least one {@link SourceSerializer} implementation instance.
 */
public SourceSerializerChain(List<? extends SourceSerializer> sourceSerializers) {
    if (CollectionUtils.isNullOrEmpty(sourceSerializers) || sourceSerializers.contains(null)) {
        throw new IllegalArgumentException("No source serializer specified or contains null serializers.");
    }
    this.sourceSerializers = new LinkedList<>(sourceSerializers);
}