1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2000,2008 Oracle. All rights reserved. 5 * 6 * $Id: TupleInputBinding.java,v 12.6 2008/01/08 20:58:36 bostic Exp $ 7 */ 8 9package com.sleepycat.bind.tuple; 10 11import com.sleepycat.bind.EntryBinding; 12import com.sleepycat.db.DatabaseEntry; 13 14/** 15 * A concrete <code>EntryBinding</code> that uses the <code>TupleInput</code> 16 * object as the key or data object. 17 * 18 * A concrete tuple binding for key or data entries which are {@link 19 * TupleInput} objects. This binding is used when tuples themselves are the 20 * objects, rather than using application defined objects. A {@link TupleInput} 21 * must always be used. To convert a {@link TupleOutput} to a {@link 22 * TupleInput}, use the {@link TupleInput#TupleInput(TupleOutput)} constructor. 23 * 24 * @author Mark Hayes 25 */ 26public class TupleInputBinding implements EntryBinding { 27 28 /** 29 * Creates a tuple input binding. 30 */ 31 public TupleInputBinding() { 32 } 33 34 // javadoc is inherited 35 public Object entryToObject(DatabaseEntry entry) { 36 37 return TupleBinding.entryToInput(entry); 38 } 39 40 // javadoc is inherited 41 public void objectToEntry(Object object, DatabaseEntry entry) { 42 43 TupleBinding.inputToEntry((TupleInput) object, entry); 44 } 45} 46