Sha256: ec5161012e3c9e9bdd3028258ec116484bbb7ea258169da7cd7451293aba4445
Contents?: true
Size: 1.34 KB
Versions: 30
Compression:
Stored size: 1.34 KB
Contents
package org.embulk.plugin; import java.util.Collections; import java.util.HashMap; import java.util.Map; public interface PluginSource { <T> T newPlugin(Class<T> iface, PluginType type) throws PluginSourceNotMatchException; public enum Type { DEFAULT("default"), // DEFAULT includes InjectedPluginSource and JRubyPluginSource. MAVEN("maven"), ; private Type(final String sourceTypeName) { this.sourceTypeName = sourceTypeName; } public static Type of(final String sourceTypeName) { final Type found = MAP_FROM_STRING.get(sourceTypeName); if (found == null) { throw new IllegalArgumentException("\"" + sourceTypeName + "\" is not a plugin source."); } return found; } @Override public final String toString() { return this.sourceTypeName; } static { final HashMap<String, Type> mapToBuild = new HashMap<String, Type>(); for (Type type : values()) { mapToBuild.put(type.sourceTypeName, type); } MAP_FROM_STRING = Collections.unmodifiableMap(mapToBuild); } private static final Map<String, Type> MAP_FROM_STRING; private final String sourceTypeName; } }
Version data entries
30 entries across 30 versions & 1 rubygems