OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SqlOptionsBuilder.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 
3 import java.util.HashMap;
4 import java.util.Map;
5 
6 public abstract class SqlOptionsBuilder {
7  protected Map<String, String> options;
8 
9  public void addOption(final String attribute, final String value) {
10  if (options == null) {
11  options = new HashMap<>();
12  }
13 
14  options.put(attribute, sanitizeOptionValue(value));
15  }
16 
17  private String sanitizeOptionValue(final String value) {
18  String sanitizedValue = value;
19  if (value.startsWith("'") && value.endsWith("'")) {
20  sanitizedValue = value.substring(1, value.length() - 1);
21  }
22  return sanitizedValue;
23  }
24 }
void addOption(final String attribute, final String value)