001/* 002 * Copyright 2012-2017 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 * http://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.boot.configurationmetadata; 018 019import java.io.Serializable; 020import java.util.LinkedHashMap; 021import java.util.Map; 022 023/** 024 * Define a component that is able to provide the values of a property. 025 * <p> 026 * Each provider is defined by a {@code name} and can have an arbitrary number of 027 * {@code parameters}. The available providers are defined in the Spring Boot 028 * documentation. 029 * 030 * @author Stephane Nicoll 031 * @since 1.3.0 032 */ 033@SuppressWarnings("serial") 034public class ValueProvider implements Serializable { 035 036 private String name; 037 038 private final Map<String, Object> parameters = new LinkedHashMap<>(); 039 040 /** 041 * Return the name of the provider. 042 * @return the name 043 */ 044 public String getName() { 045 return this.name; 046 } 047 048 public void setName(String name) { 049 this.name = name; 050 } 051 052 /** 053 * Return the parameters. 054 * @return the parameters 055 */ 056 public Map<String, Object> getParameters() { 057 return this.parameters; 058 } 059 060 @Override 061 public String toString() { 062 return "ValueProvider{" + "name='" + this.name + ", parameters=" + this.parameters 063 + '}'; 064 } 065 066}