Expression.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
7
package org.opensearch.sql.expression;
8
9
import java.io.Serializable;
10
import org.opensearch.sql.data.model.ExprValue;
11
import org.opensearch.sql.data.type.ExprType;
12
import org.opensearch.sql.expression.env.Environment;
13
14
/**
15
 * The definition of the resolved expression.
16
 */
17
public interface Expression extends Serializable {
18
19
  /**
20
   * Evaluate the value of expression that does not depend on value environment.
21
   */
22
  default ExprValue valueOf() {
23 1 1. valueOf : replaced return value with null for org/opensearch/sql/expression/Expression::valueOf → KILLED
    return valueOf(null);
24
  }
25
26
  /**
27
   * Evaluate the value of expression in the value environment.
28
   */
29
  ExprValue valueOf(Environment<Expression, ExprValue> valueEnv);
30
31
  /**
32
   * The type of the expression.
33
   */
34
  ExprType type();
35
36
  /**
37
   * Accept a visitor to visit current expression node.
38
   * @param visitor   visitor
39
   * @param context   context
40
   * @param <T>       result type
41
   * @param <C>       context type
42
   * @return          result accumulated by visitor when visiting
43
   */
44
  <T, C> T accept(ExpressionNodeVisitor<T, C> visitor, C context);
45
46
}

Mutations

23

1.1
Location : valueOf
Killed by : org.opensearch.sql.expression.parse.RegexExpressionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.parse.RegexExpressionTest]/[method:resolve_type()]
replaced return value with null for org/opensearch/sql/expression/Expression::valueOf → KILLED

Active mutators

Tests examined


Report generated by PIT 1.9.0