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.test.annotation; 018 019/** 020 * <p> 021 * Strategy interface for retrieving <em>profile values</em> for a given 022 * testing environment. 023 * </p> 024 * <p> 025 * Concrete implementations must provide a {@code public} no-args 026 * constructor. 027 * </p> 028 * <p> 029 * Spring provides the following out-of-the-box implementations: 030 * </p> 031 * <ul> 032 * <li>{@link SystemProfileValueSource}</li> 033 * </ul> 034 * 035 * @author Rod Johnson 036 * @author Sam Brannen 037 * @since 2.0 038 * @see ProfileValueSourceConfiguration 039 * @see IfProfileValue 040 * @see ProfileValueUtils 041 */ 042public interface ProfileValueSource { 043 044 /** 045 * Get the <em>profile value</em> indicated by the specified key. 046 * @param key the name of the <em>profile value</em> 047 * @return the String value of the <em>profile value</em>, or {@code null} 048 * if there is no <em>profile value</em> with that key 049 */ 050 String get(String key); 051 052}