Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 12017)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 12018)
@@ -39,16 +39,35 @@
     }
 
+    /**
+     * Returns the API type name / JOSM display name.
+     * @return the API type name / JOSM display name
+     */
     public String getAPIName() {
         return apiTypeName;
     }
 
+    /**
+     * Returns the OSM class for data values, or null.
+     * @return the OSM class for data values, or null
+     */
     public Class<? extends OsmPrimitive> getOsmClass() {
         return osmClass;
     }
 
+    /**
+     * Returns the data class.
+     * @return the data class
+     */
     public Class<? extends PrimitiveData> getDataClass() {
         return dataClass;
     }
 
+    /**
+     * Returns enum value from API type name / JOSM display name, case sensitive.
+     * @param typeName API type name / JOSM display name, case sensitive
+     * @return matching enum value
+     * @throws IllegalArgumentException if the type name does not match any valid type
+     * @see #from(String)
+     */
     public static OsmPrimitiveType fromApiTypeName(String typeName) {
         for (OsmPrimitiveType type : OsmPrimitiveType.values()) {
@@ -72,6 +91,11 @@
     }
 
+    /**
+     * Returns enum value from API type name / JOSM display name, case insensitive.
+     * @param value API type name / JOSM display name, case insensitive
+     * @return matching enum value or null
+     * @see #fromApiTypeName
+     */
     public static OsmPrimitiveType from(String value) {
-        if (value == null) return null;
         for (OsmPrimitiveType type: values()) {
             if (type.getAPIName().equalsIgnoreCase(value))
@@ -81,8 +105,19 @@
     }
 
+    /**
+     * Returns the values matching real OSM API data types (node, way, relation).
+     * @return the values matching real OSM API data types (node, way, relation)
+     */
     public static Collection<OsmPrimitiveType> dataValues() {
         return DATA_VALUES;
     }
 
+    /**
+     * Constructs a new primitive instance (node, way or relation) without version.
+     * @param uniqueId the unique id
+     * @param allowNegative {@code true} to allow negative id
+     * @return a new primitive instance (node, way or relation)
+     * @throws IllegalArgumentException if uniqueId &lt; 0 and allowNegative is false
+     */
     public OsmPrimitive newInstance(long uniqueId, boolean allowNegative) {
         switch (this) {
@@ -98,4 +133,25 @@
     }
 
+    /**
+     * Constructs a new primitive instance (node, way or relation) with given version.
+     * @param id The id. Must be &gt;= 0
+     * @param version The version
+     * @return a new primitive instance (node, way or relation) with given version
+     * @throws IllegalArgumentException if id &lt; 0
+     * @since 12018
+     */
+    public OsmPrimitive newVersionedInstance(long id, int version) {
+        switch (this) {
+        case NODE:
+            return new Node(id, version);
+        case WAY:
+            return new Way(id, version);
+        case RELATION:
+            return new Relation(id, version);
+        default:
+            throw new AssertionError();
+        }
+    }
+
     @Override
     public String toString() {
