use of org.cactoos.text.UncheckedText in project cactoos by yegor256.
the class LoggingInputStream method mark.
@Override
public void mark(final int limit) {
this.origin.mark(limit);
this.logger.log(this.level.value(), new UncheckedText(new FormattedText("Marked position %d from %s.", limit, this.source)).asString());
}
use of org.cactoos.text.UncheckedText in project cactoos by yegor256.
the class LoggingInputStream method skip.
@Override
public long skip(final long num) throws IOException {
final long skipped = this.origin.skip(num);
this.logger.log(this.level.value(), new UncheckedText(new FormattedText("Skipped %d byte(s) from %s.", skipped, this.source)).asString());
return skipped;
}
use of org.cactoos.text.UncheckedText in project cactoos by yegor256.
the class SortedTest method mustSortTextIterableAsSetUsingCustomCOmparator.
@Test
@SuppressWarnings("unchecked")
void mustSortTextIterableAsSetUsingCustomCOmparator() {
new Assertion<>("Must keep unique integer numbers sorted in descending order", new Sorted<Text>((first, second) -> {
final String left = new UncheckedText(first).asString();
final String right = new UncheckedText(second).asString();
return left.compareTo(right);
}, new TextOf("cd"), new TextOf("ab"), new TextOf("gh"), new TextOf("ef")), new IsIterableContainingInOrder<Text>(new ListOf<>(new IsText("ab"), new IsText("cd"), new IsText("ef"), new IsText("gh")))).affirm();
}
Aggregations