From 4333e2a996388f82468e42c8397b0011845ba9ff Mon Sep 17 00:00:00 2001 From: marhali Date: Mon, 11 Apr 2022 19:15:18 +0200 Subject: [PATCH] remove legacy structure --- .../easyi18n/model/KeyedTranslation.java | 44 --------------- .../easyi18n/LegacyKeyPathConverterTest.java | 54 ------------------- 2 files changed, 98 deletions(-) delete mode 100644 src/main/java/de/marhali/easyi18n/model/KeyedTranslation.java delete mode 100644 src/test/java/de/marhali/easyi18n/LegacyKeyPathConverterTest.java diff --git a/src/main/java/de/marhali/easyi18n/model/KeyedTranslation.java b/src/main/java/de/marhali/easyi18n/model/KeyedTranslation.java deleted file mode 100644 index 1e35702..0000000 --- a/src/main/java/de/marhali/easyi18n/model/KeyedTranslation.java +++ /dev/null @@ -1,44 +0,0 @@ -package de.marhali.easyi18n.model; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * I18n translation with associated key path (full-key). - * @author marhali - */ -@Deprecated // Replaced by Translation -public class KeyedTranslation { - - private @NotNull KeyPath key; - private @Nullable Translation translation; - - public KeyedTranslation(@NotNull KeyPath key, @Nullable Translation translation) { - this.key = key; - this.translation = translation; - } - - public KeyPath getKey() { - return key; - } - - public void setKey(KeyPath key) { - this.key = key; - } - - public @Nullable Translation getTranslation() { - return translation; - } - - public void setTranslation(@NotNull Translation translation) { - this.translation = translation; - } - - @Override - public String toString() { - return "KeyedTranslation{" + - "key='" + key + '\'' + - ", translation=" + translation + - '}'; - } -} \ No newline at end of file diff --git a/src/test/java/de/marhali/easyi18n/LegacyKeyPathConverterTest.java b/src/test/java/de/marhali/easyi18n/LegacyKeyPathConverterTest.java deleted file mode 100644 index 57ba445..0000000 --- a/src/test/java/de/marhali/easyi18n/LegacyKeyPathConverterTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package de.marhali.easyi18n; - -import de.marhali.easyi18n.model.KeyPath; -import de.marhali.easyi18n.model.KeyPathConverter; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Unit tests for {@link KeyPathConverter}. - * @author marhali - */ -@Deprecated -public class LegacyKeyPathConverterTest { - - private final KeyPathConverter deepMapper = new KeyPathConverter(true); - private final KeyPathConverter flatMapper = new KeyPathConverter(false); - - @Test - public void testNestedConcat() { - Assert.assertEquals("first\\\\.section.second.third", - deepMapper.concat(KeyPath.of("first.section", "second", "third"))); - - Assert.assertEquals("first.second.third", - deepMapper.concat(KeyPath.of("first", "second", "third"))); - } - - @Test - public void testNestedSplit() { - Assert.assertEquals(KeyPath.of("first.section", "second", "third"), - deepMapper.split("first\\\\.section.second.third")); - - Assert.assertEquals(KeyPath.of("first", "second", "third"), - deepMapper.split("first.second.third")); - } - - @Test - public void testNonNestedConcat() { - Assert.assertEquals("flat.map\\\\.deeper", - flatMapper.concat(KeyPath.of("flat.map", "deeper"))); - - Assert.assertEquals("flat.map.keys", - flatMapper.concat(KeyPath.of("flat.map.keys"))); - } - - @Test - public void testNonNestedSplit() { - Assert.assertEquals(KeyPath.of("flat.keys.with", "deep.section"), - flatMapper.split("flat.keys.with\\\\.deep.section")); - - Assert.assertEquals(KeyPath.of("flat.keys.only"), - flatMapper.split("flat.keys.only")); - } -} \ No newline at end of file