DependencyScope (@Nullable IdeaDependencyScope scope) { if (scope == null) { return null; } String scopeAsString = scope.getScope(); if (scopeAsString == null) { return null; } for (DependencyScope dependencyScope : DependencyScope.values()) { if (scopeAsString.equalsIgnoreCase(dependencyScope.toString())) { return dependencyScope; } } return null; }