1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.expression.env; | |
8 | ||
9 | /** | |
10 | * The definition of the environment. | |
11 | * @param <E> the type of expression | |
12 | * @param <V> the type of expression value | |
13 | */ | |
14 | public interface Environment<E, V> { | |
15 | ||
16 | /** | |
17 | * resolve the value of expression from the environment. | |
18 | */ | |
19 | V resolve(E var); | |
20 | ||
21 | /** | |
22 | * Extend the environment. | |
23 | * | |
24 | * @param env environment | |
25 | * @param expr expression. | |
26 | * @param value expression value. | |
27 | * @param <E> the type of expression | |
28 | * @param <V> the type of expression value | |
29 | * @return extended environment. | |
30 | */ | |
31 | static <E, V> Environment<E, V> extendEnv( | |
32 | Environment<E, V> env, E expr, V value) { | |
33 |
1
1. extendEnv : replaced return value with null for org/opensearch/sql/expression/env/Environment::extendEnv → KILLED |
return var -> { |
34 |
1
1. lambda$extendEnv$0 : negated conditional → KILLED |
if (var.equals(expr)) { |
35 |
1
1. lambda$extendEnv$0 : replaced return value with null for org/opensearch/sql/expression/env/Environment::lambda$extendEnv$0 → KILLED |
return value; |
36 | } else { | |
37 |
1
1. lambda$extendEnv$0 : replaced return value with null for org/opensearch/sql/expression/env/Environment::lambda$extendEnv$0 → KILLED |
return env.resolve(var); |
38 | } | |
39 | }; | |
40 | } | |
41 | } | |
Mutations | ||
33 |
1.1 |
|
34 |
1.1 |
|
35 |
1.1 |
|
37 |
1.1 |