public static Type fromString( String string ) {
            for( Type type : values() ) {
                if( type.value.equalsIgnoreCase( string ) ) {
                    return type;
                }
            }
            throw new IllegalArgumentException( "Unknown type " + string );
        }
Get the type from a given string
jgiven-core/src/main/java/com/tngtech/jgiven/attachment/MediaType.java