Created
January 2, 2018 22:35
-
-
Save anonymous/4d7d4f05feb02aff5015eb6f2c92cac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void setActualLanguage(List<SupportedLanguages> supportedLanguagesList, String actualLanguage) { | |
boolean actualLanguageExist = supportedLanguagesList.stream().anyMatch(s -> actualLanguage.equalsIgnoreCase(s.getIdentity())); | |
if (actualLanguageExist) { | |
for(SupportedLanguages supportedLanguages : supportedLanguagesList) { | |
if (actualLanguage.equalsIgnoreCase(supportedLanguages.getIdentity())) { | |
supportedLanguages.setActualLanguage(true); | |
} | |
} | |
} else { | |
for(SupportedLanguages supportedLanguages : supportedLanguagesList) { | |
if ("EN".equalsIgnoreCase(supportedLanguages.getIdentity())) { | |
supportedLanguages.setActualLanguage(true); | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment