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.autoconfigure; 018 019import java.util.Set; 020 021/** 022 * Provides access to meta-data written by the auto-configure annotation processor. 023 * 024 * @author Phillip Webb 025 * @since 1.5.0 026 */ 027public interface AutoConfigurationMetadata { 028 029 /** 030 * Return {@code true} if the specified class name was processed by the annotation 031 * processor. 032 * @param className the source class 033 * @return if the class was processed 034 */ 035 boolean wasProcessed(String className); 036 037 /** 038 * Get an {@link Integer} value from the meta-data. 039 * @param className the source class 040 * @param key the meta-data key 041 * @return the meta-data value or {@code null} 042 */ 043 Integer getInteger(String className, String key); 044 045 /** 046 * Get an {@link Integer} value from the meta-data. 047 * @param className the source class 048 * @param key the meta-data key 049 * @param defaultValue the default value 050 * @return the meta-data value or {@code defaultValue} 051 */ 052 Integer getInteger(String className, String key, Integer defaultValue); 053 054 /** 055 * Get a {@link Set} value from the meta-data. 056 * @param className the source class 057 * @param key the meta-data key 058 * @return the meta-data value or {@code null} 059 */ 060 Set<String> getSet(String className, String key); 061 062 /** 063 * Get a {@link Set} value from the meta-data. 064 * @param className the source class 065 * @param key the meta-data key 066 * @param defaultValue the default value 067 * @return the meta-data value or {@code defaultValue} 068 */ 069 Set<String> getSet(String className, String key, Set<String> defaultValue); 070 071 /** 072 * Get an {@link String} value from the meta-data. 073 * @param className the source class 074 * @param key the meta-data key 075 * @return the meta-data value or {@code null} 076 */ 077 String get(String className, String key); 078 079 /** 080 * Get an {@link String} value from the meta-data. 081 * @param className the source class 082 * @param key the meta-data key 083 * @param defaultValue the default value 084 * @return the meta-data value or {@code defaultValue} 085 */ 086 String get(String className, String key, String defaultValue); 087 088}