NamedArgumentExpression.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
package org.opensearch.sql.expression;
7
8
import lombok.EqualsAndHashCode;
9
import lombok.Getter;
10
import lombok.RequiredArgsConstructor;
11
import lombok.ToString;
12
import org.opensearch.sql.data.model.ExprValue;
13
import org.opensearch.sql.data.type.ExprType;
14
import org.opensearch.sql.expression.env.Environment;
15
16
/**
17
 * Named argument expression that represents function argument with name.
18
 */
19
@RequiredArgsConstructor
20
@Getter
21
@EqualsAndHashCode
22
@ToString
23
public class NamedArgumentExpression implements Expression {
24
  private final String argName;
25
  private final Expression value;
26
27
  @Override
28
  public ExprValue valueOf(Environment<Expression, ExprValue> valueEnv) {
29 1 1. valueOf : replaced return value with null for org/opensearch/sql/expression/NamedArgumentExpression::valueOf → KILLED
    return value.valueOf(valueEnv);
30
  }
31
32
  @Override
33
  public ExprType type() {
34 1 1. type : replaced return value with null for org/opensearch/sql/expression/NamedArgumentExpression::type → KILLED
    return value.type();
35
  }
36
37
  @Override
38
  public <T, C> T accept(ExpressionNodeVisitor<T, C> visitor, C context) {
39 1 1. accept : replaced return value with null for org/opensearch/sql/expression/NamedArgumentExpression::accept → SURVIVED
    return visitor.visitNamedArgument(this, context);
40
  }
41
}

Mutations

29

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

34

1.1
Location : type
Killed by : org.opensearch.sql.expression.NamedArgumentExpressionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.NamedArgumentExpressionTest]/[method:name_an_argument()]
replaced return value with null for org/opensearch/sql/expression/NamedArgumentExpression::type → KILLED

39

1.1
Location : accept
Killed by : none
replaced return value with null for org/opensearch/sql/expression/NamedArgumentExpression::accept → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.9.0