1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.ast.expression; | |
8 | ||
9 | import com.google.common.collect.ImmutableList; | |
10 | import java.util.Collections; | |
11 | import java.util.List; | |
12 | import lombok.EqualsAndHashCode; | |
13 | import lombok.Getter; | |
14 | import lombok.ToString; | |
15 | import org.opensearch.sql.ast.AbstractNodeVisitor; | |
16 | ||
17 | @Getter | |
18 | @ToString | |
19 | @EqualsAndHashCode(callSuper = false) | |
20 | public class Field extends UnresolvedExpression { | |
21 | ||
22 | private final UnresolvedExpression field; | |
23 | ||
24 | private final List<Argument> fieldArgs; | |
25 | ||
26 | /** | |
27 | * Constructor of Field. | |
28 | */ | |
29 | public Field(UnresolvedExpression field) { | |
30 | this(field, Collections.emptyList()); | |
31 | } | |
32 | ||
33 | /** | |
34 | * Constructor of Field. | |
35 | */ | |
36 | public Field(UnresolvedExpression field, List<Argument> fieldArgs) { | |
37 | this.field = field; | |
38 | this.fieldArgs = fieldArgs; | |
39 | } | |
40 | ||
41 | public boolean hasArgument() { | |
42 |
2
1. hasArgument : negated conditional → NO_COVERAGE 2. hasArgument : replaced boolean return with true for org/opensearch/sql/ast/expression/Field::hasArgument → NO_COVERAGE |
return !fieldArgs.isEmpty(); |
43 | } | |
44 | ||
45 | @Override | |
46 | public List<UnresolvedExpression> getChild() { | |
47 |
1
1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/expression/Field::getChild → SURVIVED |
return ImmutableList.of(this.field); |
48 | } | |
49 | ||
50 | @Override | |
51 | public <R, C> R accept(AbstractNodeVisitor<R, C> nodeVisitor, C context) { | |
52 |
1
1. accept : replaced return value with null for org/opensearch/sql/ast/expression/Field::accept → KILLED |
return nodeVisitor.visitField(this, context); |
53 | } | |
54 | } | |
Mutations | ||
42 |
1.1 2.2 |
|
47 |
1.1 |
|
52 |
1.1 |