001package jmri.util.startup;
002
003import java.util.Locale;
004
005/**
006 * Abstract implementation of {@link StartupActionFactory} that covers some
007 * boilerplate code for most implementations.
008 *
009 * @author Randall Wood (C) 2016, 2020
010 */
011abstract public class AbstractStartupActionFactory implements StartupActionFactory {
012
013    /**
014     * {@inheritDoc}
015     * <p>
016     * This implementation calls
017     * {@link #getTitle(java.lang.Class, java.util.Locale)} with the default
018     * locale.
019     *
020     * @param clazz the class
021     * @return the title
022     * @throws IllegalArgumentException if the class is not supported by this
023     *                                  factory
024     */
025    @Override
026    public String getTitle(Class<?> clazz) throws IllegalArgumentException {
027        return this.getTitle(clazz, Locale.getDefault());
028    }
029
030    /**
031     * {@inheritDoc}
032     * <p>
033     * This implementation returns an empty array.
034     *
035     * @param clazz the class
036     * @return an empty array
037     * @throws IllegalArgumentException if the class is not supported by this
038     *                                  factory
039     */
040    @Override
041    public String[] getOverriddenClasses(Class<?> clazz) throws IllegalArgumentException {
042        return new String[0];
043    }
044
045}