Class DataTypeUrl


  • public class DataTypeUrl
    extends java.lang.Object
    A class to produce and parse URLs of the form:
     	datatype:/12345678?uid=12345678&name=Bob
     
    where the first number is the ID of the DataTypeManager and the second number is the DataType ID.
    • Constructor Detail

      • DataTypeUrl

        public DataTypeUrl​(DataType dt)
        Constructs a url from the given data type
        Parameters:
        dt - the data type; cannot be null
      • DataTypeUrl

        public DataTypeUrl​(java.lang.String url)
                    throws java.lang.IllegalArgumentException
        Constructs a url from the given url string
        Parameters:
        url - the url
        Throws:
        java.lang.IllegalArgumentException - if the url does not match the expected URL_PATTERN or if there is an issue parsing the id within the given url
    • Method Detail

      • getDataTypeManagerId

        public UniversalID getDataTypeManagerId()
      • getDataTypeName

        public java.lang.String getDataTypeName()
      • getDataType

        public DataType getDataType​(DataTypeManagerService service)
        Uses the given service and its DataTypeManagers to find the data type represented by this url
        Parameters:
        service - the service
        Returns:
        the data type; null if there was an error restoring the type, such as if the parent DataTypeManager has been closed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object