Salve a tutti,

Ragazzi, ho un problema, devo controntare dei tipi enum e farmi ritornare un intero.

Codice PHP:

enum Stato 
{ROSSOGIALLOVERDE}; 
... 
... 
... 

public 
int getStatoCorrente(){       
     
if(
currentStatoSemaforo.name().equals("ROSSO")) return 0;   
         
if(
currentStatoSemaforo.name().equals("GIALLO")) return 1;   

if(
currentStatoSemaforo.name().equals("VERDE")) return 2
     

Tutto sembra normale e corretto, ma il compilatore mi da errore, e mi dice che il metodo deve restituire un intero!!

Come devo fare??

Grazie, ciao ciao