Skip to content

Commit

Permalink
(#1579) Change type in ctors
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Apr 7, 2021
1 parent a265215 commit 8b67ca5
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Abbreviated.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class Abbreviated extends TextEnvelope {
*
* @param text The Text
*/
public Abbreviated(final String text) {
public Abbreviated(final CharSequence text) {
this(new TextOf(text));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Base64Decoded.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class Base64Decoded extends TextEnvelope {
*
* @param input The String
*/
public Base64Decoded(final String input) {
public Base64Decoded(final CharSequence input) {
this(new TextOf(input));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Base64Encoded.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class Base64Encoded extends TextEnvelope {
*
* @param input The String
*/
public Base64Encoded(final String input) {
public Base64Encoded(final CharSequence input) {
this(new TextOf(input));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Capitalized.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final class Capitalized extends TextEnvelope {
*
* @param text The text
*/
public Capitalized(final String text) {
public Capitalized(final CharSequence text) {
this(new TextOf(text));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Concatenated.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Concatenated(final Text... txts) {
* Ctor.
* @param strs Strings to be concatenated
*/
public Concatenated(final String... strs) {
public Concatenated(final CharSequence... strs) {
this(
new Mapped<>(
TextOf::new,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/text/Contains.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class Contains implements Scalar<Boolean> {
* @param origin The origin
* @param other The other
*/
public Contains(final String origin, final String other) {
public Contains(final CharSequence origin, final CharSequence other) {
this(new TextOf(origin), new TextOf(other));
}

Expand All @@ -57,7 +57,7 @@ public Contains(final String origin, final String other) {
* @param origin The origin
* @param other The other
*/
public Contains(final String origin, final Text other) {
public Contains(final CharSequence origin, final Text other) {
this(new TextOf(origin), other);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/EndsWith.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class EndsWith implements Scalar<Boolean> {
* @param origin The origin
* @param suffix The suffix
*/
public EndsWith(final Text origin, final String suffix) {
public EndsWith(final Text origin, final CharSequence suffix) {
this(origin, new TextOf(suffix));
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/text/FormattedText.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public FormattedText(
* @param ptn Pattern
* @param arguments Arguments
*/
public FormattedText(final String ptn, final Collection<Object> arguments) {
public FormattedText(final CharSequence ptn, final Collection<Object> arguments) {
this(ptn, Locale.getDefault(Locale.Category.FORMAT), arguments);
}

Expand All @@ -116,7 +116,7 @@ public FormattedText(final Text ptn, final Collection<Object> arguments) {
* @param arguments Arguments
*/
public FormattedText(
final String ptn,
final CharSequence ptn,
final Locale locale,
final Collection<Object> arguments
) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/text/Joined.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final class Joined extends TextEnvelope {
* @param delimit Delimit among strings
* @param strs Strings to be joined
*/
public Joined(final String delimit, final String... strs) {
public Joined(final CharSequence delimit, final CharSequence... strs) {
this(delimit, new IterableOf<>(strs));
}

Expand All @@ -51,7 +51,7 @@ public Joined(final String delimit, final String... strs) {
* @param delimit Delimit among strings
* @param strs Strings to be joined
*/
public Joined(final String delimit, final Iterable<String> strs) {
public Joined(final CharSequence delimit, final Iterable<? extends CharSequence> strs) {
this(
new TextOf(delimit),
new Mapped<>(TextOf::new, strs)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Lowered.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class Lowered extends TextEnvelope {
* Ctor.
* @param text The text
*/
public Lowered(final String text) {
public Lowered(final CharSequence text) {
this(new TextOf(text));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Mapped.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class Mapped extends TextEnvelope {
* @param fnc Function to apply
* @param txt Original text
*/
public Mapped(final Func<String, String> fnc, final Text txt) {
public Mapped(final Func<String, ? extends CharSequence> fnc, final Text txt) {
super(new TextOf(() -> fnc.apply(txt.asString())));
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/cactoos/text/Normalized.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class Normalized extends TextEnvelope {
* Ctor.
* @param text A Text
*/
public Normalized(final String text) {
public Normalized(final CharSequence text) {
this(new TextOf(text));
}

Expand All @@ -55,4 +55,3 @@ public Normalized(final Text text) {
);
}
}

2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/PrefixOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class PrefixOf extends TextEnvelope {
* @param text Text representing the text value
* @param boundary String to which text will be split
*/
public PrefixOf(final String text, final String boundary) {
public PrefixOf(final CharSequence text, final String boundary) {
this(new TextOf(text), boundary);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Repeated.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class Repeated extends TextEnvelope {
* @param text A String
* @param count How many times repeat the Text
*/
public Repeated(final String text, final int count) {
public Repeated(final CharSequence text, final int count) {
this(new TextOf(text), count);
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/cactoos/text/Split.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class Split extends IterableEnvelope<Text> {
* @param rgx The regex
* @see String#split(String)
*/
public Split(final String text, final String rgx) {
public Split(final CharSequence text, final CharSequence rgx) {
this(new TextOf(text), new TextOf(rgx));
}

Expand All @@ -56,7 +56,7 @@ public Split(final String text, final String rgx) {
* @param lmt The limit
* @see String#split(String, int)
*/
public Split(final String text, final String rgx, final int lmt) {
public Split(final CharSequence text, final CharSequence rgx, final int lmt) {
this(new TextOf(text), new TextOf(rgx), lmt);
}

Expand All @@ -66,7 +66,7 @@ public Split(final String text, final String rgx, final int lmt) {
* @param rgx The regex
* @see String#split(String)
*/
public Split(final String text, final Text rgx) {
public Split(final CharSequence text, final Text rgx) {
this(new TextOf(text), rgx);
}

Expand All @@ -87,7 +87,7 @@ public Split(final String text, final Text rgx, final int lmt) {
* @param rgx The regex
* @see String#split(String)
*/
public Split(final Text text, final String rgx) {
public Split(final Text text, final CharSequence rgx) {
this(text, new TextOf(rgx));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/StartsWith.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public StartsWith(final Text text, final Text prefix) {
* @param text The text
* @param prefix The prefix
*/
public StartsWith(final String text, final String prefix) {
public StartsWith(final CharSequence text, final CharSequence prefix) {
this(new TextOf(text), new TextOf(prefix));
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/text/Sub.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final class Sub extends TextEnvelope {
* @param text The String
* @param strt Start position in the text
*/
public Sub(final String text, final int strt) {
public Sub(final CharSequence text, final int strt) {
this(new TextOf(text), strt);
}

Expand All @@ -52,7 +52,7 @@ public Sub(final String text, final int strt) {
* @param strt Start position in the text
* @param finish End position in the text
*/
public Sub(final String text, final int strt, final int finish) {
public Sub(final CharSequence text, final int strt, final int finish) {
this(new TextOf(text), strt, finish);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Upper.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class Upper extends TextEnvelope {
* Ctor.
* @param text The text
*/
public Upper(final String text) {
public Upper(final CharSequence text) {
this(new TextOf(text));
}

Expand Down

0 comments on commit 8b67ca5

Please sign in to comment.