Expr.fromProto constructor

Expr.fromProto(
  1. Expr proto
)

Implementation

factory Expr.fromProto(pb.Expr proto) {
  return switch (proto.whichExpr()) {
    pb.Expr_Expr.value => ExprValue.fromProto(proto.value),
    pb.Expr_Expr.variable => ExprVariable.fromProto(proto.variable),
    pb.Expr_Expr.slot => ExprSlot.fromProto(proto.slot),
    pb.Expr_Expr.unknown => ExprUnknown.fromProto(proto.unknown),
    pb.Expr_Expr.not => ExprNot.fromProto(proto.not),
    pb.Expr_Expr.negate => ExprNegate.fromProto(proto.negate),
    pb.Expr_Expr.equals => ExprEquals.fromProto(proto.equals),
    pb.Expr_Expr.notEquals => ExprNotEquals.fromProto(proto.notEquals),
    pb.Expr_Expr.in_ => ExprIn.fromProto(proto.in_),
    pb.Expr_Expr.lessThan => ExprLessThan.fromProto(proto.lessThan),
    pb.Expr_Expr.lessThanOrEquals =>
      ExprLessThanOrEquals.fromProto(proto.lessThanOrEquals),
    pb.Expr_Expr.greaterThan => ExprGreaterThan.fromProto(proto.greaterThan),
    pb.Expr_Expr.greaterThanOrEquals =>
      ExprGreaterThanOrEquals.fromProto(proto.greaterThanOrEquals),
    pb.Expr_Expr.and => ExprAnd.fromProto(proto.and),
    pb.Expr_Expr.or => ExprOr.fromProto(proto.or),
    pb.Expr_Expr.add => ExprAdd.fromProto(proto.add),
    pb.Expr_Expr.subtract => ExprSubt.fromProto(proto.subtract),
    pb.Expr_Expr.multiply => ExprMult.fromProto(proto.multiply),
    pb.Expr_Expr.contains => ExprContains.fromProto(proto.contains),
    pb.Expr_Expr.containsAll => ExprContainsAll.fromProto(proto.containsAll),
    pb.Expr_Expr.containsAny => ExprContainsAny.fromProto(proto.containsAny),
    pb.Expr_Expr.getAttribute =>
      ExprGetAttribute.fromProto(proto.getAttribute),
    pb.Expr_Expr.hasAttribute =>
      ExprHasAttribute.fromProto(proto.hasAttribute),
    pb.Expr_Expr.like => ExprLike.fromProto(proto.like),
    pb.Expr_Expr.is_ => ExprIs.fromProto(proto.is_),
    pb.Expr_Expr.ifThenElse => ExprIfThenElse.fromProto(proto.ifThenElse),
    pb.Expr_Expr.set => ExprSet.fromProto(proto.set),
    pb.Expr_Expr.record => ExprRecord.fromProto(proto.record),
    pb.Expr_Expr.extensionCall =>
      ExprExtensionCall.fromProto(proto.extensionCall),
    final unknown =>
      throw UnimplementedError('Unknown expression type: $unknown'),
  };
}