diff --git a/src/main/java/de/marhali/easyi18n/data/Translations.java b/src/main/java/de/marhali/easyi18n/data/Translations.java index f40dee0..d034866 100644 --- a/src/main/java/de/marhali/easyi18n/data/Translations.java +++ b/src/main/java/de/marhali/easyi18n/data/Translations.java @@ -8,17 +8,26 @@ import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; +/** + * Represents translation state instance. IO operations will be based on this file. + * @author marhali + */ public class Translations { - private List locales; - private LocalizedNode nodes; + private @NotNull List locales; + private @NotNull LocalizedNode nodes; - public Translations(List locales, LocalizedNode nodes) { + /** + * Constructs a new translation state instance. + * @param locales List of all locales which are used for create / edit I18n-Key operations + * @param nodes Represents the translation state. Internally handled as a tree. See {@link LocalizedNode} + */ + public Translations(@NotNull List locales, @NotNull LocalizedNode nodes) { this.locales = locales; this.nodes = nodes; } - public List getLocales() { + public @NotNull List getLocales() { return locales; } @@ -60,7 +69,7 @@ public class Translations { return node; } - public List getFullKeys() { + public @NotNull List getFullKeys() { List keys = new ArrayList<>(); if(nodes.isLeaf()) { // Root has no children @@ -74,7 +83,7 @@ public class Translations { return keys; } - public List getFullKeys(String parentFullPath, LocalizedNode localizedNode) { + public @NotNull List getFullKeys(String parentFullPath, LocalizedNode localizedNode) { List keys = new ArrayList<>(); if(localizedNode.isLeaf()) {