2 * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.northbound.commons.query;
10 /*package*/ class LogicalExpression implements Expression {
12 public static enum OP { AND, OR }
15 private final Expression _arg1;
16 private final Expression _arg2;
18 public LogicalExpression(OP op, Expression first, Expression second) {
24 public OP getOperator() {
28 public Expression getFirst() {
32 public Expression getSecond() {
37 public boolean accept(Visitor visitor) throws QueryException {
38 return visitor.visit(this);
42 public String toString() {
43 StringBuilder sb = new StringBuilder();
44 sb.append(_arg1.toString())
45 .append(_op.toString())
46 .append(_arg2.toString());