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:
  • Field Details

  • Method Details

    • fromUrn

      public static AspectModelUrn fromUrn(String urn)
      Creates a AspectModelUrn from a URN.
      Parameters:
      urn - the urn which will be parsed to create the AspectModelUrn instance
      Returns:
      AspectModelUrn containing the individual parts from the urn
      Throws:
      UrnSyntaxException - if urn is not valid
    • fromUrn

      public static AspectModelUrn fromUrn(URI urn)
      Creates a AspectModelUrn from a URN.
      Parameters:
      urn - the urn which will be parsed to create the AspectModelUrn instance
      Returns:
      AspectModelUrn containing the individual parts from the urn
      Throws:
      UrnSyntaxException - if urn is 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()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(AspectModelUrn o)
      Specified by:
      compareTo in interface Comparable<AspectModelUrn>