001package jmri.implementation;
002
003import java.util.HashSet;
004import java.util.Set;
005import javax.annotation.Nonnull;
006import jmri.InstanceInitializer;
007
008public class AbstractInstanceInitializer implements InstanceInitializer {
009
010    /**
011     * The default implementation always throws an IllegalArgumentException. If
012     * called by an overriding method, the last line of the overriding method
013     * should be {@code return super.getDefault(type);}.
014     *
015     * {@inheritDoc }
016     */
017    @Override
018    @Nonnull
019    public <T> Object getDefault(@Nonnull Class<T> type) {
020        throw new IllegalArgumentException();
021    }
022
023    /**
024     * The default implementation returns an empty set.
025     *
026     * {@inheritDoc }
027     */
028    @Override
029    @Nonnull
030    public Set<Class<?>> getInitalizes() {
031        return new HashSet<>();
032    }
033
034}