class FormatFactory {

  public static Format fromName(final String name) {
    switch (name.toUpperCase()) {
      case AvroFormat.NAME:       return AVRO;
      case JsonFormat.NAME:       return JSON;
      case JsonSchemaFormat.NAME: return JSON_SR;
      case ProtobufFormat.NAME:   return PROTOBUF;
      case KafkaFormat.NAME:      return KAFKA;
      case DelimitedFormat.NAME:  return DELIMITED;
      case NoneFormat.NAME:       return NONE;
      default:
        throw new KsqlException("Unknown format: " + name);
    }
  }

  private  FormatFactory();

}