X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2FTypeInfo.java;h=a1cc306d64d33a692aec043f6cc068f05be71fa2;hb=e253bd50bb05519f4a16fed4fb95d5b3340128ea;hp=26314fa48a016603a9b3d9066a8d6d59f13a2c90;hpb=78e4af97505df331618f9c13dd5d98440d364764;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/TypeInfo.java b/src/be/nikiroo/jvcard/TypeInfo.java index 26314fa..a1cc306 100644 --- a/src/be/nikiroo/jvcard/TypeInfo.java +++ b/src/be/nikiroo/jvcard/TypeInfo.java @@ -1,12 +1,20 @@ 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; - private Data parent; - private boolean dirty; + @SuppressWarnings("unchecked") public TypeInfo(String name, String value) { + super(null); + this.name = name; this.value = value; } @@ -19,40 +27,13 @@ public class TypeInfo { return value; } - /** - * Check if this {@link TypeInfo} has unsaved changes. - * - * @return TRUE if it has - */ - public boolean isDirty() { - return dirty; - } - - /** - * Notify that this element has unsaved changes, and notify its parent of - * the same if any. - */ - protected void setDirty() { - this.dirty = true; - if (this.parent != null) - this.parent.setDirty(); - } - - /** - * Notify this element and all its descendants that it is in pristine - * state (as opposed to dirty). - */ - void setPristine() { - dirty = false; + @Override + public String getId() { + return "" + name; } - /** - * Set the parent of this {@link TypeInfo}. - * - * @param parent - * the new parent - */ - void setParent(Data parent) { - this.parent = parent; + @Override + public String getState() { + return "" + name + value; } } \ No newline at end of file