01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2000,2008 Oracle. All rights reserved.
05: *
06: * $Id: EntityBinding.java,v 1.21.2.2 2008/01/07 15:14:05 cwl Exp $
07: */
08:
09: package com.sleepycat.bind;
10:
11: import com.sleepycat.je.DatabaseEntry;
12:
13: /**
14: * A binding between a key-value entry pair and an entity object.
15: *
16: * @author Mark Hayes
17: */
18: public interface EntityBinding {
19:
20: /**
21: * Converts key and data entry buffers into an entity Object.
22: *
23: * @param key is the source key entry.
24: *
25: * @param data is the source data entry.
26: *
27: * @return the resulting Object.
28: */
29: Object entryToObject(DatabaseEntry key, DatabaseEntry data);
30:
31: /**
32: * Extracts the key entry from an entity Object.
33: *
34: * @param object is the source Object.
35: *
36: * @param key is the destination entry buffer.
37: */
38: void objectToKey(Object object, DatabaseEntry key);
39:
40: /**
41: * Extracts the data entry from an entity Object.
42: *
43: * @param object is the source Object.
44: *
45: * @param data is the destination entry buffer.
46: */
47: void objectToData(Object object, DatabaseEntry data);
48: }
|