Disposition { public static Disposition parse(String str) { String cleaned = str.replaceAll("[ \r\n\t]+", " "); Matcher matcher = PATTERN.matcher(cleaned); if (matcher.matches()) { if (matcher.group(1) == null) return new Disposition( DispositionType.of(matcher.group(6)), null, null ); else return new Disposition( DispositionType.of(matcher.group(2)), DispositionModifier.of(matcher.group(3)), DispositionModifierExtension.of(matcher.group(4)) ); } throw new IllegalStateException(String.format("Unable to parseOld disposition '%s'.", str)); } private  Disposition(DispositionType type, DispositionModifier modifier, DispositionModifierExtension extension); static Disposition parse(String str); static Disposition fromVerifierException(VerifierException e); DispositionType getType(); DispositionModifier getModifier(); DispositionModifierExtension getExtension(); @Override String toString(); static final Disposition PROCESSED; static final Disposition UNSUPPORTED_FORMAT; static final Disposition UNSUPPORTED_MIC_ALGORITHMS; static final Disposition SENDER_EQUALS_RECEIVER; static final Disposition DECRYPTION_FAILED; static final Disposition AUTHENTICATION_FAILED; static final Disposition INTEGRITY_CHECK_FAILED; static final Disposition PARTICIPANT_NOT_ACCEPTED; static final Disposition DOCUMENT_TYPE_ID_NOT_ACCEPTED; static final Disposition PROCESS_ID_NOT_ACCEPTED; static final Disposition UNEXPECTED_PROCESSING_ERROR; static final Disposition DUPLICATE_DOCUMENT; }
@Test(expectedExceptions = IllegalStateException.class) public void invalidValue() { Disposition.parse("Hello World"); }