001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.beans; 018 019/** 020 * Holder containing one or more {@link PropertyValue} objects, 021 * typically comprising one update for a specific target bean. 022 * 023 * @author Rod Johnson 024 * @author Juergen Hoeller 025 * @since 13 May 2001 026 * @see PropertyValue 027 */ 028public interface PropertyValues { 029 030 /** 031 * Return an array of the PropertyValue objects held in this object. 032 */ 033 PropertyValue[] getPropertyValues(); 034 035 /** 036 * Return the property value with the given name, if any. 037 * @param propertyName the name to search for 038 * @return the property value, or {@code null} 039 */ 040 PropertyValue getPropertyValue(String propertyName); 041 042 /** 043 * Return the changes since the previous PropertyValues. 044 * Subclasses should also override {@code equals}. 045 * @param old old property values 046 * @return PropertyValues updated or new properties. 047 * Return empty PropertyValues if there are no changes. 048 * @see Object#equals 049 */ 050 PropertyValues changesSince(PropertyValues old); 051 052 /** 053 * Is there a property value (or other processing entry) for this property? 054 * @param propertyName the name of the property we're interested in 055 * @return whether there is a property value for this property 056 */ 057 boolean contains(String propertyName); 058 059 /** 060 * Does this holder not contain any PropertyValue objects at all? 061 */ 062 boolean isEmpty(); 063 064}