Both source name and urlPath are now supported in deserialization

This commit is contained in:
Luca Frosini 2022-09-02 12:28:40 +02:00
parent c4f314e383
commit bd0cde7838
1 changed files with 5 additions and 1 deletions

View File

@ -43,8 +43,12 @@ public enum Sources {
public static Sources onDeserialize(String sourceString) { public static Sources onDeserialize(String sourceString) {
if(sourceString != null) { if(sourceString != null) {
for(Sources source : Sources.values()) { for(Sources source : Sources.values()) {
if (source.urlPath.equalsIgnoreCase(sourceString.trim())) if (source.urlPath.equalsIgnoreCase(sourceString.trim())) {
return source; return source;
}
if (source.sourceName.equalsIgnoreCase(sourceString.trim())) {
return source;
}
} }
} }
return null; return null;