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; 020 021/** 022 * Hint for a value a given property may have. Provide the value and an optional 023 * description. 024 * 025 * @author Stephane Nicoll 026 * @since 1.3.0 027 */ 028@SuppressWarnings("serial") 029public class ValueHint implements Serializable { 030 031 private Object value; 032 033 private String description; 034 035 private String shortDescription; 036 037 /** 038 * Return the hint value. 039 * @return the value 040 */ 041 public Object getValue() { 042 return this.value; 043 } 044 045 public void setValue(Object value) { 046 this.value = value; 047 } 048 049 /** 050 * A description of this value, if any. Can be multi-lines. 051 * @return the description 052 * @see #getShortDescription() 053 */ 054 public String getDescription() { 055 return this.description; 056 } 057 058 public void setDescription(String description) { 059 this.description = description; 060 } 061 062 /** 063 * A single-line, single-sentence description of this hint, if any. 064 * @return the short description 065 * @see #getDescription() 066 */ 067 public String getShortDescription() { 068 return this.shortDescription; 069 } 070 071 public void setShortDescription(String shortDescription) { 072 this.shortDescription = shortDescription; 073 } 074 075 @Override 076 public String toString() { 077 return "ValueHint{" + "value=" + this.value + ", description='" + this.description 078 + '\'' + '}'; 079 } 080 081}