/** * 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)); } }
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(); }
/** * 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"); } }
public List<String> getSubnets() { return CollectionUtils.isNullOrEmpty(subnets) ? new ArrayList<String>() : subnets; }
public List<String> getSecurityGroups() { return CollectionUtils.isNullOrEmpty(securityGroups) ? new ArrayList<String>() : securityGroups; }
/** * 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); }