X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fcontainer%2FDataContainer.java;fp=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fcontainer%2FDataContainer.java;h=bf080e46bf0bf0d4eb0fd32f44b0a58df7f01ceb;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/container/DataContainer.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/container/DataContainer.java new file mode 100644 index 000000000..bf080e46b --- /dev/null +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/container/DataContainer.java @@ -0,0 +1,50 @@ +package org.simantics.databoard.container; + +import java.util.TreeMap; + +import org.simantics.databoard.binding.mutable.Variant; + +/** + * This is a container format primarly for encoding data to file system. + * It adds to the actual data encoded as a variant some metadata, format + * name and version information. + * @author Hannu Niemistö + */ +public class DataContainer { + /** + * Format name that tells how the data is used. + * Applications use format name to decide if the file can + * be used for the operation the user requested. + */ + public String format; + /** + * Version number of the content format. Increased every + * time the data type or the interpretation of the data + * changes. + */ + public int version; + /** + * May contain arbitrary metadata about the data such as + * author, export data etc. + */ + public TreeMap metadata; + /** + * The actual data content. + */ + public Variant content; + + public DataContainer() { + } + + public DataContainer(String format, int version, + TreeMap metadata, Variant content) { + this.format = format; + this.version = version; + this.metadata = metadata; + this.content = content; + } + + public DataContainer(String format, int version, Variant content) { + this(format, version, new TreeMap(), content); + } +}