All Downloads are FREE. Search and download functionalities are using the official Maven repository.

schemakeeper.schema.SchemaType Maven / Gradle / Ivy

package schemakeeper.schema;

import java.util.HashMap;
import java.util.Map;

public enum SchemaType {
    AVRO("avro"),
    THRIFT("thrift"),
    PROTOBUF("protobuf");

    private static final Map nameToSchemaTypeMap;

    static {
        nameToSchemaTypeMap = new HashMap<>();
        nameToSchemaTypeMap.put("avro", AVRO);
        nameToSchemaTypeMap.put("thrift", THRIFT);
        nameToSchemaTypeMap.put("protobuf", PROTOBUF);
    }

    public final String identifier;

    SchemaType(String identifier) {
        this.identifier = identifier;
    }

    public static SchemaType findByName(String name) {
        return nameToSchemaTypeMap.getOrDefault(name.toLowerCase(), AVRO);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy