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;
}
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 <i>and all its descendants</i> 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