Remote: jdoc + description + some fixes:
[jvcard.git] / src / be / nikiroo / jvcard / Data.java
index 3e0d3d5e0f7585a89cefb5d5324f362c1d4f4870..5c09a13419c1177167f4b2b1cb7bcea1fab68dbb 100644 (file)
@@ -30,17 +30,17 @@ public class Data extends BaseClass<TypeInfo> {
         * @param types
         *            the types of this {@link Data}
         * @param name
-        *            its name
+        *            its name (<b>MUST NOT</b> be NULL)
         * @param value
-        *            its value
+        *            its value (<b>MUST NOT</b> be NULL)
         * @param group
-        *            its group if any
+        *            its group if any (or NULL if none)
         */
        public Data(List<TypeInfo> types, String name, String value, String group) {
                super(types);
 
-               this.name = name;
-               this.value = value;
+               this.name = name.toUpperCase();
+               this.value = value.toString(); // crash NOW if null
                this.group = group;
 
                b64 = -1;
@@ -145,4 +145,14 @@ public class Data extends BaseClass<TypeInfo> {
        public boolean isBinary() {
                return b64 >= 0;
        }
+
+       @Override
+       public String getId() {
+               return "" + name;
+       }
+
+       @Override
+       public String getState() {
+               return ("" + name + value + group).replace(' ', '_');
+       }
 }