Package com.mysql.cj.xdevapi
Class ExprUtil
java.lang.Object
com.mysql.cj.xdevapi.ExprUtil
public class ExprUtil
extends java.lang.Object
Utilities to deal with Expr (and related) structures.
-
Constructor Summary
Constructors Constructor Description ExprUtil()
-
Method Summary
Modifier and Type Method Description static MysqlxDatatypes.Any
anyOf(MysqlxDatatypes.Scalar s)
Protocol buffers helper to build an Any Scalar type.static MysqlxExpr.Expr
argObjectToExpr(java.lang.Object value, boolean allowRelationalColumns)
Protocol buffers helper to build Expr with any object.static MysqlxDatatypes.Scalar
argObjectToScalar(java.lang.Object value)
Protocol buffers helper to build a Scalar type with any object.static MysqlxDatatypes.Any
argObjectToScalarAny(java.lang.Object value)
Protocol buffers helper to build an Any type with any object.static MysqlxDatatypes.Any
buildAny(boolean b)
Build a Protocol buffers Any with a boolean value.static MysqlxDatatypes.Any
buildAny(java.lang.String str)
Build a Protocol buffers Any with a string value.static MysqlxCrud.Collection
buildCollection(java.lang.String schemaName, java.lang.String collectionName)
Build a Protocol buffers Collection.static MysqlxExpr.Expr
buildLiteralExpr(MysqlxDatatypes.Scalar scalar)
Wrap an Any value in a LITERAL expression.static MysqlxExpr.Expr
buildLiteralNullScalar()
Protocol buffers helper to build a LITERAL Expr with a Scalar NULL type.static MysqlxExpr.Expr
buildLiteralScalar(boolean b)
Protocol buffers helper to build a LITERAL Expr with a Scalar BOOL type.static MysqlxExpr.Expr
buildLiteralScalar(byte[] bytes)
Protocol buffers helper to build a LITERAL Expr with a Scalar OCTETS type.static MysqlxExpr.Expr
buildLiteralScalar(double d)
Protocol buffers helper to build a LITERAL Expr with a Scalar DOUBLE type.static MysqlxExpr.Expr
buildLiteralScalar(long l)
Protocol buffers helper to build a LITERAL Expr with a Scalar SINT (signed int) type.static MysqlxExpr.Expr
buildLiteralScalar(java.lang.String str)
Protocol buffers helper to build a LITERAL Expr with a Scalar STRING type.static MysqlxExpr.Expr
buildPlaceholderExpr(int pos)
Creates a placeholder expression for the given position in theargs
arraystatic MysqlxDatatypes.Scalar
nullScalar()
Protocol buffers helper to build a Scalar NULL type.static MysqlxDatatypes.Scalar
scalarOf(boolean b)
Protocol buffers helper to build a Scalar BOOL type.static MysqlxDatatypes.Scalar
scalarOf(byte[] bytes)
Protocol buffers helper to build a Scalar OCTETS type.static MysqlxDatatypes.Scalar
scalarOf(double d)
Protocol buffers helper to build a Scalar DOUBLE type.static MysqlxDatatypes.Scalar
scalarOf(long l)
Protocol buffers helper to build a Scalar SINT (signed int) type.static MysqlxDatatypes.Scalar
scalarOf(java.lang.String str)
Protocol buffers helper to build a Scalar STRING type.
-
Constructor Details
-
ExprUtil
public ExprUtil()
-
-
Method Details
-
buildLiteralNullScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar NULL type.- Returns:
MysqlxExpr.Expr
-
buildLiteralScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar DOUBLE type.- Parameters:
d
- value- Returns:
MysqlxExpr.Expr
-
buildLiteralScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar SINT (signed int) type.- Parameters:
l
- value- Returns:
MysqlxExpr.Expr
-
buildLiteralScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar STRING type.- Parameters:
str
- value- Returns:
MysqlxExpr.Expr
-
buildLiteralScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar OCTETS type.- Parameters:
bytes
- value- Returns:
MysqlxExpr.Expr
-
buildLiteralScalar
Protocol buffers helper to build a LITERAL Expr with a Scalar BOOL type.- Parameters:
b
- value- Returns:
MysqlxExpr.Expr
-
buildLiteralExpr
Wrap an Any value in a LITERAL expression.- Parameters:
scalar
-MysqlxDatatypes.Scalar
- Returns:
MysqlxExpr.Expr
-
buildPlaceholderExpr
Creates a placeholder expression for the given position in theargs
array- Parameters:
pos
- the position of the placeholder in theargs
array- Returns:
MysqlxExpr.Expr
-
nullScalar
Protocol buffers helper to build a Scalar NULL type.- Returns:
MysqlxDatatypes.Scalar
-
scalarOf
Protocol buffers helper to build a Scalar DOUBLE type.- Parameters:
d
- value- Returns:
MysqlxDatatypes.Scalar
-
scalarOf
Protocol buffers helper to build a Scalar SINT (signed int) type.- Parameters:
l
- value- Returns:
MysqlxDatatypes.Scalar
-
scalarOf
Protocol buffers helper to build a Scalar STRING type.- Parameters:
str
- value- Returns:
MysqlxDatatypes.Scalar
-
scalarOf
Protocol buffers helper to build a Scalar OCTETS type.- Parameters:
bytes
- value- Returns:
MysqlxDatatypes.Scalar
-
scalarOf
Protocol buffers helper to build a Scalar BOOL type.- Parameters:
b
- value- Returns:
MysqlxDatatypes.Scalar
-
anyOf
Protocol buffers helper to build an Any Scalar type.- Parameters:
s
- value- Returns:
MysqlxDatatypes.Any
-
buildAny
Build a Protocol buffers Any with a string value.- Parameters:
str
- value- Returns:
MysqlxDatatypes.Any
-
buildAny
Build a Protocol buffers Any with a boolean value.- Parameters:
b
- value- Returns:
MysqlxDatatypes.Any
-
buildCollection
public static MysqlxCrud.Collection buildCollection(java.lang.String schemaName, java.lang.String collectionName)Build a Protocol buffers Collection.- Parameters:
schemaName
- schema namecollectionName
- collection name- Returns:
MysqlxCrud.Collection
-
argObjectToScalar
Protocol buffers helper to build a Scalar type with any object.- Parameters:
value
- value- Returns:
MysqlxDatatypes.Scalar
-
argObjectToScalarAny
Protocol buffers helper to build an Any type with any object.- Parameters:
value
- value- Returns:
MysqlxDatatypes.Any
-
argObjectToExpr
public static MysqlxExpr.Expr argObjectToExpr(java.lang.Object value, boolean allowRelationalColumns)Protocol buffers helper to build Expr with any object.- Parameters:
value
- valueallowRelationalColumns
- Are relational columns identifiers allowed?- Returns:
MysqlxExpr.Expr
-