001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.camel;
018    
019    /**
020     * A predicate which is evaluating a binary expression.
021     * <p/>
022     * The predicate has a left and right hand side expressions which
023     * is matched based on an operator.
024     * <p/>
025     * This predicate can return information about the evaluated expressions
026     * which allows you to get detailed information, so you better understand
027     * why the predicate did not match.
028     *
029     * @version $Revision: 1003810 $
030     */
031    public interface BinaryPredicate extends Predicate {
032    
033        /**
034         * Gets the operator
035         *
036         * @return the operator text
037         */
038        String getOperator();
039    
040        /**
041         * Gets the left hand side expression
042         *
043         * @return the left expression
044         */
045        Expression getLeft();
046    
047        /**
048         * Gets the right hand side expression
049         *
050         * @return the right expression
051         */
052        Expression getRight();
053    
054        /**
055         * Gets the evaluated left hand side value.
056         * <p/>
057         * Beware of thread safety that the result of the {@link #getRightValue()} may in fact be from another evaluation.
058         *
059         * @return the left value, may be <tt>null</tt> if predicate has not been matched yet.
060         */
061        Object getLeftValue();
062    
063        /**
064         * Gets the evaluated right hand side value.
065         * <p/>
066         * Beware of thread safety that the result of the {@link #getLeftValue()} may in fact be from another evaluation.
067         *
068         * @return the right value, may be <tt>null</tt> if predicate has not been matched yet.
069         */
070        Object getRightValue();
071    
072    }