@Test public void simpleParse() throws Exception { ProcessIdentifier processIdentifier = ProcessIdentifier .parse("qualifier::identifier"); Assert.assertEquals(processIdentifier.getIdentifier(), "identifier"); Assert.assertEquals(processIdentifier.getScheme().getIdentifier(), "qualifier"); try { ProcessIdentifier.parse("value"); Assert.fail(); } catch (PeppolParsingException e) { } }
public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); }
ProcessIdentifier extends AbstractQualifiedIdentifier implements Serializable { public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); } }
ProcessIdentifier extends AbstractQualifiedIdentifier implements Serializable { public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); } private  ProcessIdentifier(String value, Scheme scheme); }
ProcessIdentifier extends AbstractQualifiedIdentifier implements Serializable { public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); } private  ProcessIdentifier(String value, Scheme scheme); static ProcessIdentifier of(String identifier); static ProcessIdentifier of(String identifier, Scheme scheme); static ProcessIdentifier parse(String str); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
ProcessIdentifier extends AbstractQualifiedIdentifier implements Serializable { public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); } private  ProcessIdentifier(String value, Scheme scheme); static ProcessIdentifier of(String identifier); static ProcessIdentifier of(String identifier, Scheme scheme); static ProcessIdentifier parse(String str); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Scheme DEFAULT_SCHEME; static final ProcessIdentifier NO_PROCESS; }