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

org.influxdb.querybuilder.Ordering Maven / Gradle / Ivy

There is a newer version: 2.24
Show newest version
package org.influxdb.querybuilder;

public class Ordering implements Appendable {

  private final boolean isDesc;

  private static final String TIME_KEY = "time";

  /**
   * Influxdb ordering currently supports only time.
   *
   * @param isDesc
   */
  Ordering(final boolean isDesc) {
    this.isDesc = isDesc;
  }

  @Override
  public void appendTo(final StringBuilder stringBuilder) {
    Appender.appendName(TIME_KEY, stringBuilder);
    if (isDesc) {
      stringBuilder.append(" DESC");
    } else {
      stringBuilder.append(" ASC");
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy