BinaryExpression 二元表达式
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface BinaryExpression {
"concept": "BinaryExpression", // 产品概念
"left": LogicItem, // 左边项
"right": LogicItem, // 右边项
"operator": "+" | "-" | "*" | "/" | "%" | "==" | "!=" | ">" | "<" | ">=" | "<=" | "&&" | "||" | "startwith" | "endwith" | "like" | "in", // 运算符
}
class BinaryExpressionTreeNode {
ConceptEnum concept; // 产品概念
LogicItemTreeNode left; // 左边项
LogicItemTreeNode right; // 右边项
OperatorEnum operator; // 运算符
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/BinaryExpression",
"definitions": {
"BinaryExpression": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "BinaryExpression"
},
"left": {
"$ref": "#/definitions/LogicItem"
},
"right": {
"$ref": "#/definitions/LogicItem"
},
"operator": {
"type": "string",
"enum": [
"+",
"-",
"*",
"/",
"%",
"==",
"!=",
">",
"<",
">=",
"<=",
"&&",
"||",
"startwith",
"endwith",
"like",
"in"
]
}
},
"required": [
"concept",
"left",
"right",
"operator"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "BinaryExpression",
"left": null,
"right": null,
"operator": null
}
concept: BinaryExpression
left: null
right: null
operator: null