Merge /pub/main
[educational.data.git] / Dr.NO / src / drno / server / database / persistence / OID.java
blobe3f8f548a3cc1f1b9713628d8076029a6c0d30fe
1 /*
2 * Created on 2005-04-02
3 * This file is created 2005-04-02 and descripes OID
4 */
5 package drno.server.database.persistence;
7 /**
8 * @author tobibobi
9 */
10 public class OID {
11 public String key;
12 public Class cls;
14 public OID(Class cls, String Key) {
15 this.key = Key;
16 this.cls = cls;
19 public OID() {
20 key = new String("");
23 public OID(Class cls, Integer Key) {
24 this.key = Key.toString();
25 this.cls = cls;
27 public OID(Class cls, int Key) {
28 this.key = new Integer(Key).toString();
29 this.cls = cls;
32 public boolean equals(Object obj) {
33 OID ob = (OID)obj;
34 return (cls.equals(ob.cls) && key.equals(ob.key));
37 public String toString() {
38 return key;
41 /**
42 * @return
44 public boolean valid() {
45 if(key == null) return false;
46 if(key.length() == 0) return false;
47 if(key.equals("0")) return false;
48 return true;