From ffdb262500e3f06cfcff1f740dd267eb02438b8a Mon Sep 17 00:00:00 2001 From: igor Date: Wed, 16 Jan 2019 23:11:57 +0100 Subject: [PATCH] Renamed: Base64Text to Base64Decoded, TextBase64 to Base64Encoded (#1004) --- .../cactoos/text/{Base64Text.java => Base64Decoded.java} | 9 +++------ .../cactoos/text/{TextBase64.java => Base64Encoded.java} | 6 +++--- .../text/{Base64TextTest.java => Base64DecodedTest.java} | 6 +++--- .../text/{TextBase64Test.java => Base64EncodedTest.java} | 6 +++--- 4 files changed, 12 insertions(+), 15 deletions(-) rename src/main/java/org/cactoos/text/{Base64Text.java => Base64Decoded.java} (83%) rename src/main/java/org/cactoos/text/{TextBase64.java => Base64Encoded.java} (92%) rename src/test/java/org/cactoos/text/{Base64TextTest.java => Base64DecodedTest.java} (93%) rename src/test/java/org/cactoos/text/{TextBase64Test.java => Base64EncodedTest.java} (93%) diff --git a/src/main/java/org/cactoos/text/Base64Text.java b/src/main/java/org/cactoos/text/Base64Decoded.java similarity index 83% rename from src/main/java/org/cactoos/text/Base64Text.java rename to src/main/java/org/cactoos/text/Base64Decoded.java index c4ebd02eb4..53681ef7fc 100644 --- a/src/main/java/org/cactoos/text/Base64Text.java +++ b/src/main/java/org/cactoos/text/Base64Decoded.java @@ -31,18 +31,15 @@ /** * Decodes the origin text using the Base64 encoding scheme. * @since 0.20.2 - * @todo #980:30min Define new name for Base64Text and TextBase64 in order to - * avoid compound names. These classes are using for decode/encode text using - * the radix-64 representation. */ -public final class Base64Text extends TextEnvelope { +public final class Base64Decoded extends TextEnvelope { /** * Ctor. * * @param input The String */ - public Base64Text(final String input) { + public Base64Decoded(final String input) { this(new TextOf(input)); } @@ -51,7 +48,7 @@ public Base64Text(final String input) { * * @param origin Origin text */ - public Base64Text(final Text origin) { + public Base64Decoded(final Text origin) { super(new TextOf( new Base64Bytes( new BytesOf(origin) diff --git a/src/main/java/org/cactoos/text/TextBase64.java b/src/main/java/org/cactoos/text/Base64Encoded.java similarity index 92% rename from src/main/java/org/cactoos/text/TextBase64.java rename to src/main/java/org/cactoos/text/Base64Encoded.java index 0164aecf1d..a882d21fa7 100644 --- a/src/main/java/org/cactoos/text/TextBase64.java +++ b/src/main/java/org/cactoos/text/Base64Encoded.java @@ -34,14 +34,14 @@ * * @since 0.20.2 */ -public final class TextBase64 extends TextEnvelope { +public final class Base64Encoded extends TextEnvelope { /** * Ctor. * * @param input The String */ - public TextBase64(final String input) { + public Base64Encoded(final String input) { this(new TextOf(input)); } @@ -50,7 +50,7 @@ public TextBase64(final String input) { * * @param origin Origin text */ - public TextBase64(final Text origin) { + public Base64Encoded(final Text origin) { super((Scalar) () -> new TextOf( new BytesBase64( new BytesOf(origin) diff --git a/src/test/java/org/cactoos/text/Base64TextTest.java b/src/test/java/org/cactoos/text/Base64DecodedTest.java similarity index 93% rename from src/test/java/org/cactoos/text/Base64TextTest.java rename to src/test/java/org/cactoos/text/Base64DecodedTest.java index c168bcb498..831fc8ad13 100644 --- a/src/test/java/org/cactoos/text/Base64TextTest.java +++ b/src/test/java/org/cactoos/text/Base64DecodedTest.java @@ -30,11 +30,11 @@ import org.llorllale.cactoos.matchers.TextHasString; /** - * Test Case for {@link org.cactoos.text.Base64Text}. + * Test Case for {@link Base64Decoded}. * * @since 0.20.2 */ -public final class Base64TextTest { +public final class Base64DecodedTest { /** * Check text decodes using the Base64 encoding scheme. @@ -44,7 +44,7 @@ public final class Base64TextTest { public void checkDecode() throws IOException { MatcherAssert.assertThat( "Can't decodes text using the Base64 encoding scheme", - new Base64Text( + new Base64Decoded( "SGVsbG8h" ), new TextHasString( diff --git a/src/test/java/org/cactoos/text/TextBase64Test.java b/src/test/java/org/cactoos/text/Base64EncodedTest.java similarity index 93% rename from src/test/java/org/cactoos/text/TextBase64Test.java rename to src/test/java/org/cactoos/text/Base64EncodedTest.java index 0cd335db0f..be5b12a3f6 100644 --- a/src/test/java/org/cactoos/text/TextBase64Test.java +++ b/src/test/java/org/cactoos/text/Base64EncodedTest.java @@ -30,10 +30,10 @@ import org.llorllale.cactoos.matchers.TextHasString; /** - * Test case for {@link org.cactoos.text.TextBase64}. + * Test case for {@link Base64Encoded}. * @since 0.20.2 */ -public final class TextBase64Test { +public final class Base64EncodedTest { /** * Check text encodes using the Base64 encoding scheme. @@ -43,7 +43,7 @@ public final class TextBase64Test { public void checkEncode() throws IOException { MatcherAssert.assertThat( "Can't encodes text using the Base64 encoding scheme", - new TextBase64( + new Base64Encoded( "Hello!" ), new TextHasString(