Difference between revisions of "Operator Types"
For Information on Aspire 3.1 Click Here
m (Protected "Operator Types" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Revision as of 17:08, 3 March 2017
A special class, OperatorType, exists to represent operator types within the QPL generic query structure.
a = and("thomas","jefferson")
In the above example, "a" will be an Operator object which has an OperatorType of "AND".
Operator types must start with a letter, and are allowed to have the letters a-z, A-Z and "_" (underscore).
Type names, when used in Groovy are specified as ALL CAPS with underscores:
def BOOST_PLUS = OperatorType.create("BOOST_PLUS");
This is also the representation of the type as stored in the OperatorType class.
Type names when printed out for the user are printed in camelCase:
The OperatorType methods will automatically normalize types as needed.
Creating New Operator Types
Use the static create() method to create a new operator type:
def MY_TYPE = OperatorType.create("myType");
Note that all operator types should have a Groovy variable defined, so it can be used by later code, as necessary.