@Test public void testAcceptableStatus() { assertTrue(Status.OK.isOk()); assertTrue(Status.BATCHED_OK.isOk()); assertFalse(Status.BAD_REQUEST.isOk()); assertFalse(Status.ERROR.isOk()); assertFalse(Status.FORBIDDEN.isOk()); assertFalse(Status.NOT_FOUND.isOk()); assertFalse(Status.NOT_IMPLEMENTED.isOk()); assertFalse(Status.SERVICE_UNAVAILABLE.isOk()); assertFalse(Status.UNEXPECTED_STATE.isOk()); }
public boolean isOk() { return this == OK || this == BATCHED_OK; }
Status { public boolean isOk() { return this == OK || this == BATCHED_OK; } }
Status { public boolean isOk() { return this == OK || this == BATCHED_OK; } Status(String name, String description); }
Status { public boolean isOk() { return this == OK || this == BATCHED_OK; } Status(String name, String description); String getName(); String getDescription(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean isOk(); }
Status { public boolean isOk() { return this == OK || this == BATCHED_OK; } Status(String name, String description); String getName(); String getDescription(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean isOk(); static final Status OK; static final Status ERROR; static final Status NOT_FOUND; static final Status NOT_IMPLEMENTED; static final Status UNEXPECTED_STATE; static final Status BAD_REQUEST; static final Status FORBIDDEN; static final Status SERVICE_UNAVAILABLE; static final Status BATCHED_OK; }