Remote: jdoc + description + some fixes:
[jvcard.git] / src / be / nikiroo / jvcard / Data.java
index ef44813a0fca7d62dcaf1ed032434c97a0960be2..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;
@@ -153,6 +153,6 @@ public class Data extends BaseClass<TypeInfo> {
 
        @Override
        public String getState() {
-               return "" + name + value + group;
+               return ("" + name + value + group).replace(' ', '_');
        }
 }