2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.xpath.api;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16 * YANG XPath binary operator.
18 * @author Robert Varga
21 public enum YangBinaryOperator {
25 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-EqualityExpr">EqualityExpr</a>
29 * Operands do not equal.
31 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-EqualityExpr">EqualityExpr</a>
36 * Left-hand operand is greater than right-hand operand.
38 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
42 * Left-hand operand is greater than or equal to right-hand operand.
44 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
48 * Left-hand operand is less than right-hand operand.
50 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
54 * Left-hand operand is less than or equal to right-hand operand.
56 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
61 * Arithmetic addition.
63 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-AdditiveExpr">AdditiveExpr</a>
67 * Arithmetic subtraction.
69 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-AdditiveExpr">AdditiveExpr</a>
74 * Arithmetic multiplication.
76 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
80 * Arithmetic division.
82 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
86 * Arithmetic modulus after truncating division.
88 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
92 @SuppressFBWarnings(value = "SE_INNER_CLASS", justification = "Outer class is a retained enumeration")
93 final class Expr extends YangBinaryExpr {
94 private static final long serialVersionUID = 1L;
96 Expr(final YangExpr leftExpr, final YangExpr rightExpr) {
97 super(leftExpr, rightExpr);
101 public YangBinaryOperator getOperator() {
102 return YangBinaryOperator.this;
106 private final String str;
108 YangBinaryOperator(final String str) {
109 this.str = requireNonNull(str);
113 public String toString() {
117 public YangBinaryExpr exprWith(final YangExpr leftExpr, final YangExpr rightExpr) {
118 return new Expr(leftExpr, rightExpr);