package de.animux.android.andmal.api.manga; import de.animux.android.andmal.api.MalState; public enum State implements MalState { READING (1, "Reading"), COMPLETED (2, "Completed"), ONHOLD (3, "On Hold"), DROPPED (4, "Dropped"), PLANTOREAD (6, "Plan to read"); private final int id; private final String name; State(int id, String name) { this.id = id; this.name = name; } @Override public String toString() { return name; } public int getId() { return id; } static State valueOf(int id) { for (State s : State.values()) { if (s.getId() == id) { return s; } } return null; } }