Skip to content

Commit

Permalink
(yegor256#1579) Accept CharSequence instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Apr 7, 2021
1 parent 3e37919 commit a265215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/TextOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public TextOf(final InputStream input) {
*
* @param scalar The Scalar of String
*/
public TextOf(final Scalar<String> scalar) {
public TextOf(final Scalar<? extends CharSequence> scalar) {
this(new TextOfScalar(scalar));
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/cactoos/text/TextOfScalar.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ public final class TextOfScalar implements Text {
/**
* String value of the envelope.
*/
private final Scalar<String> origin;
private final Scalar<? extends CharSequence> origin;

/**
* Ctor.
*
* @param scalar The Scalar of String
*/
public TextOfScalar(final Scalar<String> scalar) {
public TextOfScalar(final Scalar<? extends CharSequence> scalar) {
this.origin = scalar;
}

@Override
public String asString() throws Exception {
return this.origin.value();
return this.origin.value().toString();
}

@Override
Expand Down

0 comments on commit a265215

Please sign in to comment.