001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.sources; 003 004/** 005 * This interface is used to ensure that a class can get a enum from a string. 006 * For various reasons, the fromString method cannot be implemented statically. 007 * 008 * @author Taylor Smock 009 * 010 * @param <T> The enum type 011 * @since 16545 012 */ 013public interface ICommonSource<T extends Enum<T>> { 014 /** 015 * Get the default value for the Enum 016 * @return The default value 017 */ 018 T getDefault(); 019 020 /** 021 * Returns the source category from the given category string. 022 * @param s The category string 023 * @return the source category matching the given category string 024 */ 025 T getFromString(String s); 026}