Class AspectModelUrn
- java.lang.Object
-
- io.openmanufacturing.sds.aspectmodel.urn.AspectModelUrn
-
- All Implemented Interfaces:
Comparable<AspectModelUrn>
public class AspectModelUrn extends Object implements Comparable<AspectModelUrn>
Represents the identifier URN of an Aspect Model.- See Also:
- https://openmanufacturingplatform.github.io/sds-bamm-aspect-meta-model/bamm-specification/v1.0.0/namespaces.html for the definition of the URN.
-
-
Field Summary
Fields Modifier and Type Field Description static intASPECT_NAME_INDEXstatic intMAX_URN_LENGTHstatic StringMODEL_ELEMENT_NAME_REGEXstatic PatternNAMESPACE_PATTERNstatic StringNAMESPACE_REGEXstatic StringVALID_NAMESPACE_IDENTIFIERstatic StringVALID_PROTOCOLstatic StringVERSION_REGEX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AspectModelUrn o)booleanequals(Object o)static AspectModelUrnfromUrn(String urn)Creates aAspectModelUrnfrom a URN.static AspectModelUrnfromUrn(URI urn)Creates aAspectModelUrnfrom a URN.ElementTypegetElementType()StringgetName()Returns the local name of the model element, e.g.StringgetNamespace()Returns the namespace part of the URN, e.g.URIgetUrn()Returns the full URN of the model elementStringgetUrnPrefix()Returns prefix part of the URN, i.e.StringgetVersion()Returns the version of the model element, e.g.inthashCode()booleanisBammUrn()StringtoString()
-
-
-
Field Detail
-
NAMESPACE_REGEX
public static final String NAMESPACE_REGEX
- See Also:
- Constant Field Values
-
NAMESPACE_PATTERN
public static final Pattern NAMESPACE_PATTERN
-
MODEL_ELEMENT_NAME_REGEX
public static final String MODEL_ELEMENT_NAME_REGEX
- See Also:
- Constant Field Values
-
VERSION_REGEX
public static final String VERSION_REGEX
- See Also:
- Constant Field Values
-
VALID_PROTOCOL
public static final String VALID_PROTOCOL
- See Also:
- Constant Field Values
-
VALID_NAMESPACE_IDENTIFIER
public static final String VALID_NAMESPACE_IDENTIFIER
- See Also:
- Constant Field Values
-
MAX_URN_LENGTH
public static final int MAX_URN_LENGTH
- See Also:
- Constant Field Values
-
ASPECT_NAME_INDEX
public static final int ASPECT_NAME_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromUrn
public static AspectModelUrn fromUrn(String urn)
Creates aAspectModelUrnfrom a URN.- Parameters:
urn- the urn which will be parsed to create theAspectModelUrninstance- Returns:
AspectModelUrncontaining the individual parts from the urn- Throws:
UrnSyntaxException- ifurnis not valid
-
fromUrn
public static AspectModelUrn fromUrn(URI urn)
Creates aAspectModelUrnfrom a URN.- Parameters:
urn- the urn which will be parsed to create theAspectModelUrninstance- Returns:
AspectModelUrncontaining the individual parts from the urn- Throws:
UrnSyntaxException- ifurnis not valid
-
getUrn
public URI getUrn()
Returns the full URN of the model element- Returns:
- the model URN
-
getName
public String getName()
Returns the local name of the model element, e.g. MyAspect- Returns:
- the local name of the model element
-
getVersion
public String getVersion()
Returns the version of the model element, e.g. 1.2.3- Returns:
- the version of the model element
-
getNamespace
public String getNamespace()
Returns the namespace part of the URN, e.g. com.example.foo- Returns:
- the namespace part of the URN
-
getUrnPrefix
public String getUrnPrefix()
Returns prefix part of the URN, i.e. the part up to and including the # but not including the local name, e.g. urn:bamm:com.foo.example:1.0.0#- Returns:
- the prefix part of the URN
-
getElementType
public ElementType getElementType()
-
isBammUrn
public boolean isBammUrn()
-
compareTo
public int compareTo(AspectModelUrn o)
- Specified by:
compareToin interfaceComparable<AspectModelUrn>
-
-