Query (Java SE 16 & JDK 16) (original) (raw)


public class Query extends Object

Constructs query object constraints.

The MBean Server can be queried for MBeans that meet a particular condition, using its queryNames orqueryMBeans method. The QueryExp parameter to the method can be any implementation of the interfaceQueryExp, but it is usually best to obtain the QueryExp value by calling the static methods in this class. This is particularly true when querying a remote MBean Server: a custom implementation of theQueryExp interface might not be present in the remote MBean Server, but the methods in this class return only standard classes that are part of the JMX implementation.

As an example, suppose you wanted to find all MBeans where the Enabled attribute is true and the Owner attribute is "Duke". Here is how you could construct the appropriate QueryExp by chaining together method calls:

QueryExp query = Query.and(Query.eq(Query.attr("Enabled"), Query.value(true)), Query.eq(Query.attr("Owner"), Query.value("Duke")));

Since:

1.5

Fields
static int
A code representing the div(javax.management.ValueExp, javax.management.ValueExp) expression.
static int
A code representing the eq(javax.management.ValueExp, javax.management.ValueExp) query.
static int
A code representing the geq(javax.management.ValueExp, javax.management.ValueExp) query.
static int
A code representing the gt(javax.management.ValueExp, javax.management.ValueExp) query.
static int
A code representing the leq(javax.management.ValueExp, javax.management.ValueExp) query.
static int
A code representing the lt(javax.management.ValueExp, javax.management.ValueExp) query.
static int
A code representing the minus(javax.management.ValueExp, javax.management.ValueExp) expression.
static int
A code representing the plus(javax.management.ValueExp, javax.management.ValueExp) expression.
static int
A code representing the times(javax.management.ValueExp, javax.management.ValueExp) expression.

Constructors

Returns a query expression that is the conjunction of two other query expressions.
Returns a query expression that represents a matching constraint on a string argument.
Returns a new attribute expression.
Returns a new qualified attribute expression.
Returns a query expression that represents the constraint that one value is between two other values.
[classattr](#classattr%28%29)()
Returns a new class attribute expression which can be used in any Query call that expects a ValueExp.
Returns a binary expression representing the quotient of two numeric values.
Returns a query expression that represents an equality constraint on two values.
Returns a query expression that represents a matching constraint on a string argument.
Returns a query expression that represents a "greater than or equal to" constraint on two values.
Returns a query expression that represents a "greater than" constraint on two values.
Returns an expression constraining a value to be one of an explicit list.
Returns a query expression that represents a matching constraint on a string argument.
Returns a query expression that represents an inheritance constraint on an MBean class.
Returns a query expression that represents a "less than or equal to" constraint on two values.
Returns a query expression that represents a "less than" constraint on two values.
Returns a query expression that represents a matching constraint on a string argument.
Returns a binary expression representing the difference between two numeric values.
Returns a constraint that is the negation of its argument.
Returns a query expression that is the disjunction of two other query expressions.
Returns a binary expression representing the sum of two numeric values, or the concatenation of two string values.
Returns a binary expression representing the product of two numeric values.
[value](#value%28boolean%29)​(boolean val)
Returns a boolean value expression that can be used in any Query call that expects a ValueExp.
[value](#value%28double%29)​(double val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
[value](#value%28float%29)​(float val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
[value](#value%28int%29)​(int val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
[value](#value%28long%29)​(long val)
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
Returns a numeric value expression that can be used in any Query call that expects a ValueExp.
Returns a new string expression.

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)