Interval.java

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 java.util.Collections;
10
import java.util.List;
11
import lombok.EqualsAndHashCode;
12
import lombok.Getter;
13
import lombok.RequiredArgsConstructor;
14
import lombok.ToString;
15
import org.opensearch.sql.ast.AbstractNodeVisitor;
16
17
@Getter
18
@ToString
19
@EqualsAndHashCode(callSuper = false)
20
@RequiredArgsConstructor
21
public class Interval extends UnresolvedExpression {
22
23
  private final UnresolvedExpression value;
24
  private final IntervalUnit unit;
25
26
  public Interval(UnresolvedExpression value, String unit) {
27
    this.value = value;
28
    this.unit = IntervalUnit.of(unit);
29
  }
30
31
  @Override
32
  public List<UnresolvedExpression> getChild() {
33 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/expression/Interval::getChild → NO_COVERAGE
    return Collections.singletonList(value);
34
  }
35
36
  @Override
37
  public <R, C> R accept(AbstractNodeVisitor<R, C> nodeVisitor, C context) {
38 1 1. accept : replaced return value with null for org/opensearch/sql/ast/expression/Interval::accept → KILLED
    return nodeVisitor.visitInterval(this, context);
39
  }
40
}

Mutations

33

1.1
Location : getChild
Killed by : none
replaced return value with Collections.emptyList for org/opensearch/sql/ast/expression/Interval::getChild → NO_COVERAGE

38

1.1
Location : accept
Killed by : org.opensearch.sql.analysis.ExpressionAnalyzerTest.[engine:junit-jupiter]/[class:org.opensearch.sql.analysis.ExpressionAnalyzerTest]/[method:interval()]
replaced return value with null for org/opensearch/sql/ast/expression/Interval::accept → KILLED

Active mutators

Tests examined


Report generated by PIT 1.9.0