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

Version Path
embulk-0.8.39 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.39-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.38 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.38-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.37 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.37-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.36 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.36-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.35 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.35-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.34 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.34-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.33 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.33-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.32 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.32-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.31 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.31-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.30 embulk-core/src/main/java/org/embulk/plugin/PluginSource.java
embulk-0.8.30-java embulk-core/src/main/java/org/embulk/plugin/PluginSource.java