Advertisement
Guest User

IssueStatus

a guest
Mar 28th, 2015
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. package fr.bluebird.report;
  2.  
  3. import net.md_5.bungee.api.ChatColor;
  4.  
  5. public enum IssueStatus {
  6.  
  7.     OPEN(0, ChatColor.GREEN + "Ouverte"), CLOSED(1, ChatColor.RED + "Ferme"), INVALID(2, ChatColor.GOLD + "Invalide");
  8.  
  9.     private final int index;
  10.     private final String name;
  11.  
  12.     private IssueStatus(int index, String name) {
  13.         this.index = index;
  14.         this.name = name;
  15.     }
  16.  
  17.     public int getIndex() {
  18.         return index;
  19.     }
  20.  
  21.     public String getName() {
  22.         return name;
  23.     }
  24.  
  25.     public static IssueStatus valueOf(int index) {
  26.         for(IssueStatus status : values())
  27.             if(status.getIndex() == index)
  28.                 return status;
  29.         return null;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement