IntConditional.fromXMLNode constructor

  1. @override
IntConditional.fromXMLNode(
  1. XMLNode node
)

Implementation

@override
IntConditional.fromXMLNode(XMLNode node)
    : value = node.attributes.entries
          .map((entry) {
            switch (entry.key) {
              case 'equals':
                return IntEquals(int.parse(entry.value));
              case 'morethan':
                return IntMoreThan(int.parse(entry.value));
              case 'lessthan':
                return IntLessThan(int.parse(entry.value));
              default:
                return null;
            }
          })
          .whereType<IntConditionalValue>()
          .toSet(),
      condition = Condition.fromChildrenMap(node.childrenToMap());