Merge branch '1.5.x'

This commit is contained in:
Stephane Nicoll
2018-01-18 13:59:19 +01:00
3 changed files with 29 additions and 2 deletions

View File

@@ -267,6 +267,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
"java.util.Collection<java.lang.Byte>"));
assertThat(metadata).has(Metadata.withProperty("collection.doubles",
"java.util.List<java.lang.Double>"));
assertThat(metadata).has(Metadata.withProperty("collection.names-to-holders",
"java.util.Map<java.lang.String,org.springframework.boot.configurationsample.simple.SimpleCollectionProperties.Holder<java.lang.String>>"));
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,8 @@ public class SimpleCollectionProperties {
private final List<Double> doubles = new ArrayList<>();
private final Map<String, Holder<String>> namesToHolders = new HashMap<>();
public Map<Integer, String> getIntegersToNames() {
return this.integersToNames;
}
@@ -81,4 +83,18 @@ public class SimpleCollectionProperties {
return this.doubles;
}
public Map<String, Holder<String>> getNamesToHolders() {
return this.namesToHolders;
}
public static class Holder<T> {
private T target;
public void setTarget(T target) {
this.target = target;
}
}
}