Use Java naming conventions
[yaz4j-moved-to-github.git] / src / main / java / org / yaz4j / Record.java
1 package org.yaz4j;
2
3 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_record_p;
4 import org.yaz4j.jni.SWIGTYPE_p_int;
5 import org.yaz4j.jni.yaz4jlib;
6
7 public class Record {
8
9     private SWIGTYPE_p_ZOOM_record_p record = null;
10     private ResultSet resultSet = null;
11     private boolean disposed = false;
12
13     Record(SWIGTYPE_p_ZOOM_record_p record, ResultSet resultSet) {
14         this.resultSet = resultSet;
15         this.record = record;
16     }
17
18     public void finalize() {
19         dispose();
20     }
21
22     public byte[] get(String type) {
23         SWIGTYPE_p_int length = null;
24         return yaz4jlib.ZOOM_record_get_bytes(record, type, length);
25     }
26
27     public String render() {
28         return new String(get("render"));
29     }
30
31     public byte[] getContent() {
32         return get("raw");
33     }
34
35     public String getSyntax() {
36         return new String(get("syntax"));
37     }
38
39     public String getDatabase() {
40         return new String(get("database"));
41     }
42
43     public void dispose() {
44         if (!disposed) {
45             resultSet = null;
46             record = null;
47             disposed = true;
48         }
49     }
50 }