mancala/apps/backend/src/main/java/app/playmancala/model/GameResult.java

19 lines
482 B
Java
Raw Normal View History

package app.playmancala.model;
import com.fasterxml.jackson.annotation.JsonProperty;
public enum GameResult {
@JsonProperty("player1") PLAYER1,
@JsonProperty("player2") PLAYER2,
@JsonProperty("draw") DRAW;
// The value stored in the games.result column.
public String wireName() {
return name().toLowerCase();
}
public static GameResult fromWireName(String value) {
return value == null ? null : valueOf(value.toUpperCase());
}
}