Convert null to Enum.NULL

Viewed 6658

I have an Enum like this:

public enum Type{
    CSV, EXCEL, PDF, URL, NULL
}

now I read a String from an xml-file and use Type.valueOf(string); to parse the value to the enum. if this part does not exist in the xml-file, the string is null and not "null". Is there a way to convert null to "null" or should change the return null; to return "null";? or should null not even be a part of the enum?

2 Answers
Related