Skip to content

Instantly share code, notes, and snippets.

@vojkny
Created May 11, 2016 12:37
Show Gist options
  • Save vojkny/40c14e4c73fdd8941268d618f5d12fee to your computer and use it in GitHub Desktop.
Save vojkny/40c14e4c73fdd8941268d618f5d12fee to your computer and use it in GitHub Desktop.
status
public enum Status {
OPEN("open"),
PENDING("pending"),
CLOSED("closed"),
FAILED("failed"),
PARTIAL_REFUNDED("partial_refunded"),
REFUNDED("refunded"),
PREAUTH("preauth"),
CHARGEBACK("chargeback"),
UNDEFINED("undefined");
private String value;
private Status( final String value ) {
this.value = value;
}
@JsonValue
public String getValue() {
return this.value;
}
@JsonCreator
public static Status create( final String value ) {
for( Status status : Status.values() ) {
if( status.getValue().equals( value ) ) {
return status;
}
}
return Status.UNDEFINED;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment