Class CodeFinder


  • public class CodeFinder
    extends Object
    Helper methods to find an error code in an enumeration implementing ErrorCode.
    Author:
    Manuele Simi (ISTI CNR)
    • Constructor Detail

      • CodeFinder

        public CodeFinder()
    • Method Detail

      • findAndConvert

        public static <E extends Enum<E> & ErrorCode> E findAndConvert​(ErrorCode code,
                                                                       E[] codes)
        Finds and convert the given code as enum value.
        Parameters:
        code - the code to look for.
        codes - the enum values.
        Returns:
        the code as enum value or null if the code is not found.