src/main/java/com/hedera/hashgraph/identity/DidParser.java
/**
   * Parses the given DID string into it's corresponding Hedera DID object.
   *
   * @param didString DID string.
   * @return {@link HederaDid} instance.
   */
Parses the given DID string into it's corresponding Hedera DID object.

@param didString DID string.
Parses the given DID string into it ' s corresponding Hedera DID object . @param didString DID string .
public static HederaDid parse(final String didString) {
    final int methodIndex = DidSyntax.DID_PREFIX.length() + 1;
    if (didString == null || didString.length() <= methodIndex) {
      throw new IllegalArgumentException("DID string cannot be null");
    }
    if (didString.startsWith(HcsDid.DID_METHOD.toString() + DidSyntax.DID_METHOD_SEPARATOR, methodIndex)) {
      return HcsDid.fromString(didString);
    } else {
      throw new IllegalArgumentException("DID string is invalid.");
    }
  }
public static HederaDid parse ( final String didString ) { final int methodIndex = DidSyntax . DID_PREFIX . length ( ) + 1 ; if ( didString == null || didString . length ( ) <= methodIndex ) { throw new IllegalArgumentException ( "DID string cannot be null" ) ; } if ( didString . startsWith ( HcsDid . DID_METHOD . toString ( ) + DidSyntax . DID_METHOD_SEPARATOR , methodIndex ) ) { return HcsDid . fromString ( didString ) ; } else { throw new IllegalArgumentException ( "DID string is invalid." ) ; } }
Parses the given DID string into it's corresponding Hedera DID object.
Parses the given DID string into it ' s corresponding Hedera DID object .