Created
May 11, 2016 12:37
-
-
Save vojkny/40c14e4c73fdd8941268d618f5d12fee to your computer and use it in GitHub Desktop.
status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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