Document that MapPropertySource should not contain null values

Closes gh-25142
This commit is contained in:
Juergen Hoeller 2020-05-29 15:49:36 +02:00
parent bec89dba4c
commit ef626e992d
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2020 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.
@ -23,6 +23,8 @@ import org.springframework.util.StringUtils;
/**
* {@link PropertySource} that reads keys and values from a {@code Map} object.
* The underlying map should not contain any {@code null} values in order to
* comply with {@link #getProperty} and {@link #containsProperty} semantics.
*
* @author Chris Beams
* @author Juergen Hoeller
@ -31,6 +33,12 @@ import org.springframework.util.StringUtils;
*/
public class MapPropertySource extends EnumerablePropertySource<Map<String, Object>> {
/**
* Create a new {@code MapPropertySource} with the given name and {@code Map}.
* @param name the associated name
* @param source the Map source (without {@code null} values in order to get
* consistent {@link #getProperty} and {@link #containsProperty} behavior)
*/
public MapPropertySource(String name, Map<String, Object> source) {
super(name, source);
}