public static Target indexValuesAsc(String indexName) { return new Target("indexvaluesasc:" + indexName); }
public Target(String target) { if (shouldBeEscaped(target)) { this.target = "`" + target + "`"; } else { this.target = target; } }
public AbstractQuery setTarget(String target) { this.target = target(target); return this; }
private boolean shouldBeEscaped(String target) { int indexOf = target.indexOf('-'); if(indexOf == -1) { return false; } boolean betweenQuotes = between(target, indexOf, '\''); if(betweenQuotes) { return false; } boolean betweenApostrophes = between(target, indexOf, '`'); if(betweenApostrophes) { return false; } return true; }
private boolean shouldBeEscaped(String target) { int indexOf = target.indexOf('-'); if(indexOf == -1) { return false; } boolean betweenQuotes = between(target, indexOf, '\''); if(betweenQuotes) { return false; } boolean betweenApostrophes = between(target, indexOf, '`'); if(betweenApostrophes) { return false; } return true; }
public static Target target(String target) { return new Target(target); }
public Target(String name) { if (shouldBeEscaped(name)) { this.name = j.join("`", name, "`"); } else { this.name = name; } }
protected AbstractQuery from(String target) { this.target = target(target); return this; }
public static Target cluster(String cluster) { return new Target(CLUSTER + cluster); }
public static Target index(String indexName) { return new Target("index:" + indexName); }
public static Target target(String target) { return new Target(target); }
public static Target indexValues(String indexName) { return new Target("indexvalues:" + indexName); }
public static Target indexValuesDesc(String indexName) { return new Target("indexvaluesdesc:" + indexName); }
public static Target cluster(int cluster) { return new Target(CLUSTER + Integer.toString(cluster)); }
public static Target index(String indexName) { return new Target(j.join("index:", indexName)); }
public static Target indexValuesAsc(String indexName) { return new Target(j.join("indexvaluesasc:", indexName)); }
public static Target cluster(String cluster) { return new Target(j.join(CLUSTER, cluster)); }
public static Target indexValues(String indexName) { return new Target(j.join("indexvalues:", indexName)); }
public static Target indexValuesDesc(String indexName) { return new Target(j.join("indexvaluesdesc:", indexName)); }
public static Target cluster(int cluster) { return new Target(j.join(CLUSTER, Integer.toString(cluster))); }