Condition.java
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.jackrabbit.oak.api.PropertyState
* org.apache.jackrabbit.oak.api.Tree
*/
package com.adobe.aemfd.formsfoundation.oak.restrictions.impl;
import com.adobe.aemfd.formsfoundation.oak.restrictions.impl.Path;
import com.adobe.aemfd.formsfoundation.oak.restrictions.impl.Value;
import java.util.List;
import java.util.Objects;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
public class Condition {
private final Tree tree;
private final PropertyState propertyState;
private final List<String> values;
public Condition(Tree tree, PropertyState propertyState, List<String> values) {
this.tree = tree;
this.propertyState = propertyState;
this.values = values;
}
private boolean evaluateEquality(String arg1, String arg2) {
Path pe = new Path(this.tree, this.propertyState, arg1);
Value lvalue = pe.evaluate();
Value rvalue = Value.fromLiteral(arg2);
return Objects.equals(lvalue, rvalue);
}
public boolean evaluate() {
return this.evaluateEquality(this.values.get(0), this.values.get(1));
}
}