private static LogPriorType intToType ( int intPrior ) { LogPriorType [ ] values = LogPriorType . values ( ) ; for ( LogPriorType val : values ) { if ( val . ordinal ( ) == intPrior ) { return val ; } } throw new IllegalArgumentException ( intPrior + " is not a legal LogPrior." ) ; }
why isn t this functionality in enum?