Commits

Anonymous committed 1e21c7a

This commit was manufactured by cvs2svn to create branch 'os'.

git-svn-id: http://svn.opensymphony.com/svn/propertyset/branches/os@52bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

Comments (0)

Files changed (1)

src/java/com/opensymphony/module/propertyset/hibernate/PropertySetItem.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset.hibernate;
+
+import java.io.Serializable;
+
+import java.util.Date;
+
+
+/**
+ *
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
+public class PropertySetItem implements Serializable {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    Date dateVal;
+    String entityName;
+    String key;
+    String stringVal;
+    boolean booleanVal;
+    double doubleVal;
+    int intVal;
+    int type;
+    long entityId;
+    long longVal;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    //needed for hibernate
+    public PropertySetItem() {
+    }
+
+    public PropertySetItem(String entityName, long entityId, String key) {
+        this.entityName = entityName;
+        this.entityId = entityId;
+        this.key = key;
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setBooleanVal(boolean booleanVal) {
+        this.booleanVal = booleanVal;
+    }
+
+    public boolean getBooleanVal() {
+        return booleanVal;
+    }
+
+    public void setDateVal(Date dateVal) {
+        this.dateVal = dateVal;
+    }
+
+    public Date getDateVal() {
+        return dateVal;
+    }
+
+    public void setDoubleVal(double doubleVal) {
+        this.doubleVal = doubleVal;
+    }
+
+    public double getDoubleVal() {
+        return doubleVal;
+    }
+
+    public void setEntityId(long entityId) {
+        this.entityId = entityId;
+    }
+
+    public long getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityName(String entityName) {
+        this.entityName = entityName;
+    }
+
+    public String getEntityName() {
+        return entityName;
+    }
+
+    public void setIntVal(int intVal) {
+        this.intVal = intVal;
+    }
+
+    public int getIntVal() {
+        return intVal;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setLongVal(long longVal) {
+        this.longVal = longVal;
+    }
+
+    public long getLongVal() {
+        return longVal;
+    }
+
+    public void setStringVal(String stringVal) {
+        this.stringVal = stringVal;
+    }
+
+    public String getStringVal() {
+        return stringVal;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public boolean equals(Object obj) {
+        if (!(obj instanceof PropertySetItem)) {
+            return false;
+        }
+
+        PropertySetItem item = (PropertySetItem) obj;
+
+        return ((item.getEntityId() == entityId) && item.getEntityName().equals(entityName) && item.getKey().equals(key));
+    }
+
+    public int hashCode() {
+        return (int) (entityId + entityName.hashCode() + key.hashCode());
+    }
+}