errorCodeByUniqueName function

ErrorCode errorCodeByUniqueName (
  1. String uniqueName
)

Return the ErrorCode with the given uniqueName, or null if not found.

Implementation

ErrorCode errorCodeByUniqueName(String uniqueName) {
  if (_uniqueNameToCodeMap == null) {
    _uniqueNameToCodeMap = HashMap<String, ErrorCode>();
    for (ErrorCode errorCode in errorCodeValues) {
      _uniqueNameToCodeMap[errorCode.uniqueName] = errorCode;
    }
  }
  return _uniqueNameToCodeMap[uniqueName];
}