X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2FTypeInfo.java;h=2585cfbdd4deb68c12152cfc592cc4274f543c71;hb=1c03abafc3987d93fa682e7b8758e51bed8a4faf;hp=760f75ce54caa9bfe711ea56a368954bcb2843d0;hpb=26d2bd0591901a8d52bd24802a8d6827d0e9b833;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/TypeInfo.java b/src/be/nikiroo/jvcard/TypeInfo.java index 760f75c..2585cfb 100644 --- a/src/be/nikiroo/jvcard/TypeInfo.java +++ b/src/be/nikiroo/jvcard/TypeInfo.java @@ -6,24 +6,52 @@ package be.nikiroo.jvcard; * @author niki * */ -@SuppressWarnings("rawtypes") // expected +@SuppressWarnings("rawtypes") public class TypeInfo extends BaseClass { private String name; private String value; - @SuppressWarnings("unchecked") // expected + /** + * 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) { super(null); - this.name = name; - this.value = value; + 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