io.deephaven.api.expression.Method Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-table-api Show documentation
Show all versions of deephaven-table-api Show documentation
The Deephaven table operations API
The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.api.expression;
import io.deephaven.annotations.BuildableStyle;
import io.deephaven.api.filter.Filter;
import io.deephaven.api.filter.FilterNot;
import org.immutables.value.Value.Immutable;
import java.util.List;
/**
* Represents a method call.
*/
@Immutable
@BuildableStyle
public abstract class Method implements Expression, Filter {
public static Builder builder() {
return ImmutableMethod.builder();
}
public static Method of(Expression object, String name, Expression... arguments) {
return builder().object(object).name(name).addArguments(arguments).build();
}
public static Method of(Expression object, String name, List extends Expression> arguments) {
return builder().object(object).name(name).addAllArguments(arguments).build();
}
/**
* The method object.
*
* @return the method object
*/
public abstract Expression object();
/**
* The method name.
*
* @return the method name
*/
public abstract String name();
/**
* The method arguments.
*
* @return the method arguments
*/
public abstract List arguments();
@Override
public final FilterNot invert() {
return Filter.not(this);
}
@Override
public final T walk(Expression.Visitor visitor) {
return visitor.visit(this);
}
@Override
public final T walk(Filter.Visitor visitor) {
return visitor.visit(this);
}
public interface Builder {
Builder object(Expression object);
Builder name(String name);
Builder addArguments(Expression element);
Builder addArguments(Expression... elements);
Builder addAllArguments(Iterable extends Expression> elements);
Method build();
}
}