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.Collections;
020import java.util.EventObject;
021import java.util.List;
022import java.util.Set;
023
024/**
025 * Event fired when auto-configuration classes are imported.
026 *
027 * @author Phillip Webb
028 * @since 1.5.0
029 */
030public class AutoConfigurationImportEvent extends EventObject {
031
032        private final List<String> candidateConfigurations;
033
034        private final Set<String> exclusions;
035
036        public AutoConfigurationImportEvent(Object source,
037                        List<String> candidateConfigurations, Set<String> exclusions) {
038                super(source);
039                this.candidateConfigurations = Collections
040                                .unmodifiableList(candidateConfigurations);
041                this.exclusions = Collections.unmodifiableSet(exclusions);
042        }
043
044        /**
045         * Return the auto-configuration candidate configurations that are going to be
046         * imported.
047         * @return the auto-configuration candidates
048         */
049        public List<String> getCandidateConfigurations() {
050                return this.candidateConfigurations;
051        }
052
053        /**
054         * Return the exclusions that were applied.
055         * @return the exclusions applied
056         */
057        public Set<String> getExclusions() {
058                return this.exclusions;
059        }
060
061}