Skip to content

Commit

Permalink
Improved algorythm sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
caputoortega committed Jul 30, 2022
1 parent a5009a1 commit 4304700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file added LanguageMapper_v1.1.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions src/ar/com/caputo/util/languagemapper/LanguageMapper.java
Expand Up @@ -71,8 +71,8 @@ public class LanguageMapper {
**/
public LanguageMapper(Language language, Class<? extends Enum<?>> template, String filePath) {

this.language = language == null ? this.defaultLanguage : language;
if (template == null) throw new NullPointerException("template must not be null");
this.language = language == null ? this.defaultLanguage : language;
this.template = template;
this.filePath = filePath == null ? "assets/lang/" : filePath;

Expand All @@ -95,9 +95,9 @@ public LanguageMapper(Language language, Class<? extends Enum<?>> template, Stri
**/
private boolean map() throws LanguageFileNotFoundException, LanguageKeyNotFoundException, InvalidLangKeyTemplateException {

LanguageFile languageFile = new LanguageFile(this.language, this.filePath);

if(!Set.of(this.template.getInterfaces()).contains(LangKeyTemplate.class)) throw new InvalidLangKeyTemplateException(this.template);

LanguageFile languageFile = new LanguageFile(this.language, this.filePath);

// Retrieve all fields from the template class and iterate through them.
for (Field templateField : this.template.getDeclaredFields()) {
Expand Down

0 comments on commit 4304700

Please sign in to comment.