X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2FTypeInfo.java;h=2585cfbdd4deb68c12152cfc592cc4274f543c71;hb=1c03abafc3987d93fa682e7b8758e51bed8a4faf;hp=b3851b20e5cbca48437185c71696bd0857bc5407;hpb=ce822a7cd8ff95a031e477e37d23c114228cc5b6;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/TypeInfo.java b/src/be/nikiroo/jvcard/TypeInfo.java index b3851b2..2585cfb 100644 --- a/src/be/nikiroo/jvcard/TypeInfo.java +++ b/src/be/nikiroo/jvcard/TypeInfo.java @@ -1,19 +1,57 @@ package be.nikiroo.jvcard; -public class TypeInfo { +/** + * This class describes a type, that is, a key-value pair. + * + * @author niki + * + */ +@SuppressWarnings("rawtypes") +public class TypeInfo extends BaseClass { private String name; private String value; + /** + * Create a new {@link TypeInfo}. + * + * @param name + * the name of this {@link TypeInfo} (MUST NOT be NULL) + * @param value + * its value (MUST NOT be NULL) + */ + @SuppressWarnings("unchecked") public TypeInfo(String name, String value) { - this.name = name; - this.value = value; + super(null); + + this.name = name.toUpperCase(); + this.value = value.toString(); // crash NOW if null } + /** + * Return the name. + * + * @return the name + */ public String getName() { return name; } + /** + * Return the value. + * + * @return the value + */ public String getValue() { return value; } + + @Override + public String getId() { + return "" + name; + } + + @Override + public String getState() { + return "" + name + value; + } } \ No newline at end of file