add quick constructor

This commit is contained in:
marhali 2022-02-02 19:28:50 +01:00
parent 39783c52d2
commit a3ceb736d4

View File

@ -3,7 +3,9 @@ package de.marhali.easyi18n.model;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
/**
* Translation tree node. Manages child nodes which can be translations or also
@ -27,6 +29,10 @@ public class TranslationNode {
@NotNull
private Translation value;
public TranslationNode(boolean sort) {
this(sort ? new TreeMap<>() : new LinkedHashMap<>());
}
/**
* Root node initializer. E.g. see {@link java.util.TreeMap} or {@link java.util.HashMap}
* @param children Decide which implementation should be used (sorted, non-sorted)