@Test public void testIsValid() { final String tcmUri = String.format("tcm:%s-%s-%s", PUBLICATION_ID, ITEM_ID, ITEM_TYPE); final String ishUri = String.format("ish:%s-%s-%s", PUBLICATION_ID, ITEM_ID, ITEM_TYPE); final String incorrectUri = "incorrect:33-4f-zz"; assertThat(TCMURI.isValid(tcmUri), is(true)); assertThat(TCMURI.isValid(ishUri), is(true)); assertThat(TCMURI.isValid(incorrectUri), is(false)); }
public static boolean isValid(String tcmUri) { return tcmUri != null && getNamespaceFor(tcmUri.split(":")[0]) != null; }
TCMURI implements Serializable { public static boolean isValid(String tcmUri) { return tcmUri != null && getNamespaceFor(tcmUri.split(":")[0]) != null; } }
TCMURI implements Serializable { public static boolean isValid(String tcmUri) { return tcmUri != null && getNamespaceFor(tcmUri.split(":")[0]) != null; } TCMURI(String uri);  TCMURI(String uri, int version);  TCMURI(int publicationId, int itemId, int itemType);  TCMURI(int publicationId, int itemId, int itemType, int version);  TCMURI(Namespace namespace, int publicationId, int itemId, int itemType, int version); private  TCMURI(Builder builder); }
TCMURI implements Serializable { public static boolean isValid(String tcmUri) { return tcmUri != null && getNamespaceFor(tcmUri.split(":")[0]) != null; } TCMURI(String uri);  TCMURI(String uri, int version);  TCMURI(int publicationId, int itemId, int itemType);  TCMURI(int publicationId, int itemId, int itemType, int version);  TCMURI(Namespace namespace, int publicationId, int itemId, int itemType, int version); private  TCMURI(Builder builder); static boolean isValid(String tcmUri); static int safeLongToInt(long l); @Override String toString(); int getItemType(); int getItemId(); int getPublicationId(); int getVersion(); }
TCMURI implements Serializable { public static boolean isValid(String tcmUri) { return tcmUri != null && getNamespaceFor(tcmUri.split(":")[0]) != null; } TCMURI(String uri);  TCMURI(String uri, int version);  TCMURI(int publicationId, int itemId, int itemType);  TCMURI(int publicationId, int itemId, int itemType, int version);  TCMURI(Namespace namespace, int publicationId, int itemId, int itemType, int version); private  TCMURI(Builder builder); static boolean isValid(String tcmUri); static int safeLongToInt(long l); @Override String toString(); int getItemType(); int getItemId(); int getPublicationId(); int getVersion(); static final String URI_NAMESPACE; }