package core;

public enum Action {
	Apple("Apple"), Facebook("Facebook"), Trydea("Trydea"), Google("Google");

	private String name;

	private Action(String name) {
		this.name = name;
	}

	public static boolean estValide(String s) {
		for(Action a : Action.values())
			if(a.name.equalsIgnoreCase(s))
				return true;
		return false;
	}

	public static Action from(String s) {
		for(Action a : Action.values())
			if(a.name.equalsIgnoreCase(s))
				return a;
		System.out.println("ERROR Action.from " + s);
		return null;
	}
}

@@ -7,16 +7,42 @@
 e core;%0A
+import java.util.Arrays;%0A%0A
 %0Apublic 
@@ -152,16 +152,18 @@
 ng name;
+%0A%09
 %0A%0A%09priva
@@ -206,25 +206,151 @@
  = name;%0A%09%7D%0A
+%09private static int nombreActions()%7B%0A%09%09int compteur=0;%0A%09%09for (Action a : Action.values())%0A%09%09%09compteur++;%0A%09%09return compteur;%0A%09%7D
 %0A
-
 %09public stat
@@ -656,16 +656,16 @@
 %22 + s);%0A
-
 %09%09return
@@ -674,10 +674,248 @@
 ull;%0A%09%7D%0A
+%09public static String%5B%5D nomActions() %7B%0A%09%09String%5B%5D vectName= new String%5BnombreActions()%5D;%0A%09%09int compteur=0;%0A%09%09for(Action a : Action.values())%7B%0A%09%09%09vectName%5Bcompteur%5D=a.name;%0A%09%09%09compteur++;%0A%09%09%7D%0A%09%09Arrays.sort(vectName);%0A%09%09return vectName;%0A%09%7D%0A
 %7D%0A

Update Action.java