View Javadoc
1   /*
2    * Copyright 2002-2012 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.beans;
18  
19  /**
20   * Holder containing one or more {@link PropertyValue} objects,
21   * typically comprising one update for a specific target bean.
22   *
23   * @author Rod Johnson
24   * @author Juergen Hoeller
25   * @since 13 May 2001
26   * @see PropertyValue
27   */
28  public interface PropertyValues {
29  
30  	/**
31  	 * Return an array of the PropertyValue objects held in this object.
32  	 */
33  	PropertyValue[] getPropertyValues();
34  
35  	/**
36  	 * Return the property value with the given name, if any.
37  	 * @param propertyName the name to search for
38  	 * @return the property value, or {@code null}
39  	 */
40  	PropertyValue getPropertyValue(String propertyName);
41  
42  	/**
43  	 * Return the changes since the previous PropertyValues.
44  	 * Subclasses should also override {@code equals}.
45  	 * @param old old property values
46  	 * @return PropertyValues updated or new properties.
47  	 * Return empty PropertyValues if there are no changes.
48  	 * @see Object#equals
49  	 */
50  	PropertyValues changesSince(PropertyValues old);
51  
52  	/**
53  	 * Is there a property value (or other processing entry) for this property?
54  	 * @param propertyName the name of the property we're interested in
55  	 * @return whether there is a property value for this property
56  	 */
57  	boolean contains(String propertyName);
58  
59  	/**
60  	 * Does this holder not contain any PropertyValue objects at all?
61  	 */
62  	boolean isEmpty();
63  
64  }