summaryrefslogblamecommitdiffstats
path: root/src/de/animux/android/andmal/api/anime/State.java
blob: 9ba476984e568db22cc387bc01d7d2558e978361 (plain) (tree)
1
2
3
4
5

                                           


                                             
































                                                
package de.animux.android.andmal.api.anime;

import de.animux.android.andmal.api.MalState;

public enum State implements MalState {
	WATCHING (1, "Watching"),
	COMPLETED (2, "Completed"),
	ONHOLD (3, "On Hold"),
	DROPPED (4, "Dropped"),
	PLANTOWATCH (6, "Plan to watch");
	
	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;
	}
}