docs: @Override
    public IdType setValue(String theValue) {
      // TODO: add validation
      super.setValue(theValue);
      myHaveComponentParts = false;
  
      if (StringUtils.isBlank(theValue)) {
        myBaseUrl = null;
        super.setValue(null);
        myUnqualifiedId = null;
        myUnqualifiedVersionId = null;
        myResourceType = null;
      } else if (theValue.charAt(0) == '#' && theValue.length() > 1) {
        super.setValue(theValue);
        myBaseUrl = null;
        myUnqualifiedId = theValue;
        myUnqualifiedVersionId = null;
        myResourceType = null;
        myHaveComponentParts = true;
      } else if (theValue.startsWith(URN_PREFIX)) {
        myBaseUrl = null;
        myUnqualifiedId = theValue;
        myUnqualifiedVersionId = null;
        myResourceType = null;
        myHaveComponentParts = true;
      } else {
        int vidIndex = theValue.indexOf("/_history/");
        int idIndex;
        if (vidIndex != -1) {
          myUnqualifiedVersionId = theValue.substring(vidIndex + "/_history/".length());
          idIndex = theValue.lastIndexOf('/', vidIndex - 1);
          myUnqualifiedId = theValue.substring(idIndex + 1, vidIndex);
        } else {
          idIndex = theValue.lastIndexOf('/');
          myUnqualifiedId = theValue.substring(idIndex + 1);
          myUnqualifiedVersionId = null;
        }
  
        myBaseUrl = null;
        if (idIndex <= 0) {
          myResourceType = null;
        } else {
          int typeIndex = theValue.lastIndexOf('/', idIndex - 1);
          if (typeIndex == -1) {
            myResourceType = theValue.substring(0, idIndex);
          } else {
            if (typeIndex > 0 && '/' == theValue.charAt(typeIndex - 1)) {
              typeIndex = theValue.indexOf('/', typeIndex + 1);
            }
            if (typeIndex >= idIndex) {
              // e.g. http://example.org/foo
              // 'foo' was the id but we're making that the resource type. Nullify the id part because we don't have an id.
              // Also set null value to the super.setValue() and enable myHaveComponentParts so it forces getValue() to properly
              // recreate the url
              myResourceType = myUnqualifiedId;
              myUnqualifiedId = null;
              super.setValue(null);
              myHaveComponentParts = true;
            } else {
              myResourceType = theValue.substring(typeIndex + 1, idIndex);
            }
  
            if (typeIndex > 4) {
              myBaseUrl = theValue.substring(0, typeIndex);
            }
  
          }
        }
  
      }
      return this;
    }