Enum OsmPrimitiveType

    • Method Detail

      • values

        public static OsmPrimitiveType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OsmPrimitiveType c : OsmPrimitiveType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OsmPrimitiveType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getAPIName

        public java.lang.String getAPIName()
        Returns the API type name / JOSM display name.
        Returns:
        the API type name / JOSM display name
      • getOsmClass

        public java.lang.Class<? extends OsmPrimitivegetOsmClass()
        Returns the OSM class for data values, or null.
        Returns:
        the OSM class for data values, or null
      • getDataClass

        public java.lang.Class<? extends PrimitiveDatagetDataClass()
        Returns the data class.
        Returns:
        the data class
      • fromApiTypeName

        public static OsmPrimitiveType fromApiTypeName​(java.lang.String typeName)
        Returns enum value from API type name / JOSM display name, case sensitive.
        Parameters:
        typeName - API type name / JOSM display name, case sensitive
        Returns:
        matching enum value
        Throws:
        java.lang.IllegalArgumentException - if the type name does not match any valid type
        See Also:
        from(String)
      • from

        public static OsmPrimitiveType from​(IPrimitive obj)
        Determines the OSM primitive type of the given object.
        Parameters:
        obj - the OSM object to inspect
        Returns:
        the OSM primitive type of obj
        Throws:
        java.lang.IllegalArgumentException - if obj is null or of unknown type
      • from

        public static OsmPrimitiveType from​(java.lang.String value)
        Returns enum value from API type name / JOSM display name, case insensitive.
        Parameters:
        value - API type name / JOSM display name, case insensitive
        Returns:
        matching enum value or null
        See Also:
        fromApiTypeName(java.lang.String)
      • dataValues

        public static java.util.Collection<OsmPrimitiveTypedataValues()
        Returns the values matching real OSM API data types (node, way, relation).
        Returns:
        the values matching real OSM API data types (node, way, relation)
      • newInstance

        public OsmPrimitive newInstance​(long uniqueId,
                                        boolean allowNegative)
        Constructs a new primitive instance (node, way or relation) without version.
        Parameters:
        uniqueId - the unique id
        allowNegative - true to allow negative id
        Returns:
        a new primitive instance (node, way or relation)
        Throws:
        java.lang.IllegalArgumentException - if uniqueId < 0 and allowNegative is false
      • newVersionedInstance

        public OsmPrimitive newVersionedInstance​(long id,
                                                 int version)
        Constructs a new primitive instance (node, way or relation) with given version.
        Parameters:
        id - The id. Must be >= 0
        version - The version
        Returns:
        a new primitive instance (node, way or relation) with given version
        Throws:
        java.lang.IllegalArgumentException - if id < 0
        Since:
        12018
      • getIdGenerator

        public UniqueIdGenerator getIdGenerator()
        Returns the unique identifier generator.
        Returns:
        the unique identifier generator
        Since:
        15820