/******************************************************************************* * Copyright (c) 2010 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ package org.simantics.databoard.example.old; import org.simantics.databoard.Bindings; import org.simantics.databoard.adapter.Adapter; import org.simantics.databoard.binding.Binding; public class TypeAdaptionExample1 { public enum Cars { Audio, BMW, Mercedes, Honda, Mazda, Toyota, Ford, Mitsubishi, Nissan, GM } public enum JapaneseCars { Honda, Mazda, Toyota, Nissan, Mitsubishi } public static void main(String[] args) throws Exception { Binding carsBinding = Bindings.getBinding( Cars.class ); Binding japaneseCarsBinding = Bindings.getBinding( JapaneseCars.class ); Adapter adapter = Bindings.adapterFactory.getAdapter(japaneseCarsBinding, carsBinding, true, false); System.out.println( adapter.adapt( JapaneseCars.Honda ) ); } }