Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Jan 14, 2019
2 parents c425c36 + 327b41f commit 247e34b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 25 deletions.
4 changes: 0 additions & 4 deletions src/main/java/org/cactoos/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,5 @@
* @since 0.1
* @see <a href="http://www.cactoos.org">Project site www.cactoos.org</a>
* @see <a href="https://github.com/yegor256/cactoos">GitHub repository</a>
* @todo #964:30min Continue applying the new class naming convention in effect:
* avoid compound names for decorators. Continue renaming classes according to
* this table: https://github.com/yegor256/cactoos/issues/913#issuecomment-402332247.
* Remaining packages are scalar, set, text, and time.
*/
package org.cactoos;
4 changes: 4 additions & 0 deletions src/main/java/org/cactoos/scalar/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
* Scalars.
*
* @since 0.12
* @todo #980:30min Continue applying the new class naming convention in effect:
* avoid compound names for decorators. Continue renaming classes implementing
* the {@link org.cactoos.Scalar}. More details you can find here
* https://github.com/yegor256/cactoos/issues/913#issuecomment-402332247.
*/
package org.cactoos.scalar;
4 changes: 4 additions & 0 deletions src/main/java/org/cactoos/set/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
* Sets.
*
* @since 0.49.2
* @todo #980:30min Continue applying the new class naming convention in effect:
* avoid compound names for decorators. Continue renaming classes implementing
* the {@link java.util.Set}. More details you can find here
* https://github.com/yegor256/cactoos/issues/913#issuecomment-402332247.
*/
package org.cactoos.set;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* TextEnvelope - asString() should be removed and implementation from
* TextEnvelope should be used.
*/
public final class AbbreviatedText implements Text {
public final class Abbreviated implements Text {

/**
* The default max line width.
Expand Down Expand Up @@ -64,7 +64,7 @@ public final class AbbreviatedText implements Text {
*
* @param text The Text
*/
public AbbreviatedText(final String text) {
public Abbreviated(final String text) {
this(new TextOf(text));
}

Expand All @@ -75,8 +75,8 @@ public AbbreviatedText(final String text) {
*
* @param text The Text
*/
public AbbreviatedText(final Text text) {
this(text, AbbreviatedText.MAX_WIDTH);
public Abbreviated(final Text text) {
this(text, Abbreviated.MAX_WIDTH);
}

/**
Expand All @@ -85,7 +85,7 @@ public AbbreviatedText(final Text text) {
* @param text A String
* @param max Max width of the result string
*/
public AbbreviatedText(final String text, final int max) {
public Abbreviated(final String text, final int max) {
this(new TextOf(text), max);
}

Expand All @@ -94,7 +94,7 @@ public AbbreviatedText(final String text, final int max) {
* @param text The Text
* @param max Max width of the result string
*/
public AbbreviatedText(final Text text, final int max) {
public Abbreviated(final Text text, final int max) {
this.origin = text;
this.width = max;
}
Expand All @@ -110,7 +110,7 @@ public String asString() throws Exception {
new SubText(
this.origin,
0,
this.width - AbbreviatedText.ELLIPSES_WIDTH
this.width - Abbreviated.ELLIPSES_WIDTH
).asString()
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/cactoos/text/Base64Text.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
/**
* 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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @since 0.18
*/
public final class SyncText implements Text {
public final class Synced implements Text {

/**
* The text.
Expand All @@ -48,7 +48,7 @@ public final class SyncText implements Text {
* Ctor.
* @param text The text
*/
public SyncText(final Text text) {
public Synced(final Text text) {
this(text, text);
}

Expand All @@ -57,7 +57,7 @@ public SyncText(final Text text) {
* @param text The text
* @param lck The lock
*/
public SyncText(final Text text, final Object lck) {
public Synced(final Text text, final Object lck) {
this.origin = text;
this.lock = lck;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/cactoos/text/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
* Text.
*
* @since 0.1
* @todo #980:30min Continue applying the new class naming convention in effect:
* avoid compound names for decorators. Continue renaming classes implementing
* the {@link org.cactoos.Text}. More details you can find here
* https://github.com/yegor256/cactoos/issues/913#issuecomment-402332247.
*/
package org.cactoos.text;
4 changes: 4 additions & 0 deletions src/main/java/org/cactoos/time/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
* Time.
*
* @since 1.0
* @todo #980:30min Classes from package {@link org.cactoos.time} which are
* ending with `AsText` are extending TextEnvelope. It means that they are
* instances of {@link org.cactoos.Text}. They should be merged with
* {@link org.cactoos.text.TextOf} as ctor(s).
*/
package org.cactoos.time;
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
import org.llorllale.cactoos.matchers.TextHasString;

/**
* Test case for {@link AbbreviatedText}.
* Test case for {@link Abbreviated}.
* @since 0.29
* @checkstyle JavadocMethodCheck (500 lines)
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class AbbreviatedTextTest {
public final class AbbreviatedTest {

@Test
public void abbreviatesAnEmptyText() {
final String msg = "";
MatcherAssert.assertThat(
"Can't abbreviate an msg text",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText(msg, 8),
new Abbreviated(msg, 8),
new TextHasString(msg)
);
}
Expand All @@ -51,7 +51,7 @@ public void abbreviatesText() {
MatcherAssert.assertThat(
"Can't abbreviate a text",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("hello world", 8),
new Abbreviated("hello world", 8),
new TextHasString("hello...")
);
}
Expand All @@ -61,7 +61,7 @@ public void abbreviatesTextOneCharSmaller() {
MatcherAssert.assertThat(
"Can't abbreviate a text one char smaller",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText("oo programming", 10),
new Abbreviated("oo programming", 10),
new TextHasString("oo prog...")
);
}
Expand All @@ -72,7 +72,7 @@ public void abbreviatesTextWithSameLength() {
MatcherAssert.assertThat(
"Can't abbreviate a text with same length",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText(msg, 15),
new Abbreviated(msg, 15),
new TextHasString(msg)
);
}
Expand All @@ -83,7 +83,7 @@ public void abbreviatesTextOneCharBigger() {
MatcherAssert.assertThat(
"Can't abbreviate a text one char bigger",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText(msg, 17),
new Abbreviated(msg, 17),
new TextHasString(msg)
);
}
Expand All @@ -94,7 +94,7 @@ public void abbreviatesTextTwoCharsBigger() {
MatcherAssert.assertThat(
"Can't abbreviate a text two chars bigger",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText(msg, 15),
new Abbreviated(msg, 15),
new TextHasString(msg)
);
}
Expand All @@ -105,7 +105,7 @@ public void abbreviatesTextWithWidthBiggerThanLength() {
MatcherAssert.assertThat(
"Can't abbreviate a text with width bigger than length",
// @checkstyle MagicNumber (1 line)
new AbbreviatedText(msg, 50),
new Abbreviated(msg, 50),
new TextHasString(msg)
);
}
Expand All @@ -115,7 +115,7 @@ public void abbreviatesTextBiggerThanDefaultMaxWidth() {
// @checkstyle LineLengthCheck (10 line)
MatcherAssert.assertThat(
"Can't abbreviate a text bigger than default max width",
new AbbreviatedText(
new Abbreviated(
"The quick brown fox jumps over the lazy black dog and after that returned to the cave"
),
new TextHasString(
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/cactoos/text/TextOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class TextOfTest {
public void readsInputIntoText() throws Exception {
MatcherAssert.assertThat(
"Can't read text from Input",
new SyncText(
new Synced(
new TextOf(
new InputOf("привет, друг!"),
StandardCharsets.UTF_8
Expand Down

6 comments on commit 247e34b

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 964-1a0e1078 disappeared from src/main/java/org/cactoos/package-info.java, that's why I closed #980. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 980-c8642680 discovered in src/main/java/org/cactoos/set/package-info.java and submitted as #1003. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 980-4cee6100 discovered in src/main/java/org/cactoos/text/Base64Text.java and submitted as #1004. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 980-cde865ee discovered in src/main/java/org/cactoos/text/package-info.java and submitted as #1005. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 980-a6f67b21 discovered in src/main/java/org/cactoos/time/package-info.java and submitted as #1006. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 247e34b Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 980-ea22ff49 discovered in src/main/java/org/cactoos/scalar/package-info.java and submitted as #1007. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.