public static SubjectType fromString(String type){
  if (type != null) {
    for (    SubjectType subjectType : SubjectType.values()) {
      if (type.equalsIgnoreCase(subjectType.type)) {
        return subjectType;
      }
    }
  }
  return null;
}

public static SubjectType fromString ( String type ) { if ( type != null ) { for ( SubjectType subjectType : SubjectType . values ( ) ) { if ( type . equalsIgnoreCase ( subjectType . type ) ) { return subjectType ; } } } return null ; }
translates a string type into a subject type .
