Match 匹配
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Match {
"concept": "Match", // 产品概念
"expression": LogicItem, // 逻辑项
"isExpression": boolean, // 是否表达式形态
"cases": Array<MatchCase>, // 匹配分支列表
}
class MatchTreeNode {
ConceptEnum concept; // 产品概念
LogicItemTreeNode expression; // 逻辑项
boolean isExpression; // 是否表达式形态
List<MatchCaseTreeNode> cases; // 匹配分支列表
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Match",
"definitions": {
"Match": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "Match"
},
"expression": {
"$ref": "#/definitions/LogicItem"
},
"isExpression": {
"type": "boolean"
},
"cases": {
"type": "array",
"items": {
"$ref": "#/definitions/MatchCase"
}
}
},
"required": [
"concept",
"expression",
"isExpression",
"cases"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Match",
"expression": null,
"isExpression": false,
"cases": []
}
concept: Match
expression: null
isExpression: false
cases: []