001    /**
002     * $Id: Contract.java,v 1.2 2010/06/08 21:32:53 oboehm Exp $
003     *
004     * Copyright (c) 2008 by Oliver Boehm
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     *
018     * (c)reated 29.01.2009 by oliver (ob@oasd.de)
019     */
020    package patterntesting.runtime.dbc;
021    
022    /**
023     * With this Contract interface you can realize Design-by-Contract, also known
024     * as DbC.
025     *
026     * @author <a href="boehm@javatux.de">oliver</a>
027     * @since 29.01.2009
028     * @version $Revision: 1.2 $
029     *
030     * @{link "http://csd.informatik.uni-oldenburg.de/~jass/ (as another approach for DbC)"}
031     */
032    public interface Contract {
033    
034        /**
035         * This method checks if the conditions of the invariants are still true.
036         * It is evaluated at the end of each method call (e.g. you can think of
037         * it as a global postcondition).
038         *
039         * @return true otherwise the invariant contract was violated
040         */
041        boolean invariant();
042    
043    }