001/* Copyright (C) 2013 TU Dortmund
002 * This file is part of LearnLib, http://www.learnlib.de/.
003 *
004 * LearnLib is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License version 3.0 as published by the Free Software Foundation.
007 *
008 * LearnLib is distributed in the hope that it will be useful,
009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011 * Lesser General Public License for more details.
012 *
013 * You should have received a copy of the GNU Lesser General Public
014 * License along with LearnLib; if not, see
015 * <http://www.gnu.de/documents/lgpl.en.html>.
016 */
017package de.learnlib.drivers.api;
018
019/**
020 * A data mapper transforms abstract inputs into concrete inputs and
021 * concrete outputs into abstract outputs. A mapper can be stateful.
022 * Mappers are used by test drivers.
023 * 
024 * @author falkhowar
025 * 
026 * @param <AI> abstract input type
027 * @param <CI> concrete input type
028 * @param <AO> abstract output type
029 * @param <CO> concrete output type
030 */
031public interface DataMapper<AI, AO, CI extends ExecutableInput<CO>, CO> {
032
033    /**
034     * called by a test driver before execution of a test case
035     */
036    public void pre();
037    
038    /**
039     * called by a test driver after execution of a test case
040     */
041    public void post();
042
043    /**
044     * called to transform an abstract into a concrete input
045     */
046    public CI input(AI i);
047    
048    /**
049     * called to transform a concrete output into an abstract one
050     */
051    public AO output(CO o);
052    
053    /**
054     * called to transform a concrete error into an abstract one
055     */
056    public AO exception(SULException t);
057    
058}