ExpirationAction implements Serializable { public static ExpirationAction fromXmlString(String xmlValue) { switch (xmlValue) { case "invalidate": return INVALIDATE; case "destroy": return DESTROY; case "local-destroy": return LOCAL_DESTROY; case "local-invalidate": return LOCAL_INVALIDATE; default: throw new IllegalArgumentException("invalid expiration action: " + xmlValue); } } private  ExpirationAction(String name); boolean isInvalidate(); boolean isLocalInvalidate(); boolean isDestroy(); boolean isLocalDestroy(); boolean isLocal(); boolean isDistributed(); @Override String toString(); String toXmlString(); static ExpirationAction fromXmlString(String xmlValue); static ExpirationAction fromOrdinal(int ordinal); @Immutable
  static final ExpirationAction INVALIDATE; @Immutable
  static final ExpirationAction LOCAL_INVALIDATE; @Immutable
  static final ExpirationAction DESTROY; @Immutable
  static final ExpirationAction LOCAL_DESTROY; final int ordinal; }
@Test public void fromXmlString() throws Exception { assertThat(ExpirationAction.fromXmlString("local-destroy")) .isEqualTo(ExpirationAction.LOCAL_DESTROY); assertThat(ExpirationAction.fromXmlString("destroy")).isEqualTo(ExpirationAction.DESTROY); assertThat(ExpirationAction.fromXmlString("local-invalidate")) .isEqualTo(ExpirationAction.LOCAL_INVALIDATE); assertThat(ExpirationAction.fromXmlString("invalidate")).isEqualTo(ExpirationAction.INVALIDATE); assertThatThrownBy(() -> ExpirationAction.fromXmlString("invalid")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("invalid expiration action: invalid"); }