package io.ddf.datasource;

public enum DataFormat {
  UNDEF, SQL, CSV, TSV, JSON, PQT;

  public static DataFormat fromInt(int x) {
    switch(x) {
      case 0:
        return SQL;
      case 1:
        return CSV;
      case 2:
        return TSV;
      case 3:
        return JSON;
      case 4:
        return PQT;
      default:
        return UNDEF;
    }
  }
}

@@ -359,11 +359,443 @@
    %7D%0A  %7D
+%0A%0A  public static DataFormat fromString(String x) %7B%0A    if (x.equalsIgnoreCase(%22SQL%22)) %7B%0A      return SQL;%0A    %7D else if (x.equalsIgnoreCase(%22CSV%22)) %7B%0A      return CSV;%0A    %7D else if (x.equalsIgnoreCase(%22TSV%22)) %7B%0A      return TSV;%0A    %7D else if (x.equalsIgnoreCase(%22JSON%22)) %7B%0A      return JSON;%0A    %7D else if (x.equalsIgnoreCase(%22PQT%22) %7C%7C x.equalsIgnoreCase(%22parquet%22)) %7B%0A      return PQT;%0A    %7D else %7B%0A      return UNDEF;%0A    %7D%0A  %7D
 %0A%7D%0A

support conversion from string to DataFormat