class NameUtils {

    @Nullable
    public static String toEnumName( @Nullable Object value )
    {
        if ( value == null )
        {
            return null;
        }
        final String stringValue = value.toString();
        if ( stringValue == null )
        {
            return null;
        }
        if ( stringValue.length() == 0 )
        {
            return stringValue;
        }
        if ( containsNoLowerCase( stringValue ) )
        {
            return stringValue.replace( '-', '_' );
        }

        return Arrays.stream( StringUtils.splitByCharacterTypeCamelCase( stringValue.replace( '-', '_' ) ) )
            .filter( v -> !v.equals( "_" ) ).collect( Collectors.joining( "_" ) ).toUpperCase();
    }

    private  NameUtils();

}