use of io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.Literal in project deephaven-core by deephaven.
the class FilterValue method ofString.
@JsMethod(namespace = "dh.FilterValue")
public static FilterValue ofString(Object input) {
Objects.requireNonNull(input);
final String string;
if (Js.typeof(input).equals("string")) {
string = (String) input;
} else {
string = input.toString();
}
Literal lit = new Literal();
lit.setStringValue(string);
return new FilterValue(lit);
}
use of io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.Literal in project deephaven-core by deephaven.
the class FilterValue method ofBoolean.
@JsMethod(namespace = "dh.FilterValue")
public static FilterValue ofBoolean(Boolean b) {
Objects.requireNonNull(b);
Literal lit = new Literal();
lit.setBoolValue(b);
return new FilterValue(lit);
}
use of io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.Literal in project deephaven-core by deephaven.
the class FilterValue method ofNumber.
@JsMethod(namespace = "dh.FilterValue")
public static FilterValue ofNumber(Object input) {
Objects.requireNonNull(input);
if (input instanceof DateWrapper) {
Literal lit = new Literal();
lit.setNanoTimeValue(((DateWrapper) input).valueOf());
return new FilterValue(lit);
} else if (input instanceof LongWrapper) {
Literal lit = new Literal();
lit.setLongValue(((LongWrapper) input).valueOf());
return new FilterValue(lit);
} else if (Js.typeof(input).equals("number")) {
Literal lit = new Literal();
lit.setDoubleValue(Js.asDouble(input));
return new FilterValue(lit);
} else {
// not sure what the input is, try to toString(), then parse to Double, and use that
Literal lit = new Literal();
lit.setDoubleValue(Double.parseDouble(input.toString()));
return new FilterValue(lit);
}
}
Aggregations