Skip to content

Commit

Permalink
#37 guava replaced with cactoos
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 20, 2017
1 parent 8591a0a commit 57f7045
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.jcabi</groupId>
<artifactId>parent</artifactId>
<version>0.47</version>
<version>0.48.5</version>
</parent>
<groupId>io.jare</groupId>
<artifactId>web</artifactId>
Expand Down Expand Up @@ -111,9 +111,9 @@
<version>0.22</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<groupId>org.cactoos</groupId>
<artifactId>cactoos</artifactId>
<version>0.11.4</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/jare/cached/CdBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
*/
package io.jare.cached;

import com.google.common.collect.Iterables;
import com.jcabi.aspects.Cacheable;
import io.jare.model.Base;
import io.jare.model.Domain;
import io.jare.model.User;
import java.util.concurrent.TimeUnit;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.cactoos.list.MappedIterable;

/**
* Cached Base.
Expand Down Expand Up @@ -64,7 +64,7 @@ public User user(final String name) {
@Override
@Cacheable(lifetime = 1, unit = TimeUnit.MINUTES)
public Iterable<Domain> domain(final String name) {
return Iterables.transform(
return new MappedIterable<>(
this.origin.domain(name),
CdDomain::new
);
Expand All @@ -73,7 +73,7 @@ public Iterable<Domain> domain(final String name) {
@Override
@Cacheable(unit = TimeUnit.HOURS, lifetime = 1)
public Iterable<Domain> all() {
return Iterables.transform(
return new MappedIterable<>(
this.origin.all(),
CdDomain::new
);
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/io/jare/tk/TkRelay.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
package io.jare.tk;

import com.google.common.collect.Iterables;
import io.jare.model.Base;
import io.jare.model.Domain;
import java.io.IOException;
Expand All @@ -33,6 +32,8 @@
import java.util.Iterator;
import java.util.Locale;
import java.util.regex.Pattern;
import org.cactoos.list.ConcatIterable;
import org.cactoos.list.SkippedIterable;
import org.takes.HttpException;
import org.takes.Request;
import org.takes.Response;
Expand All @@ -48,6 +49,7 @@
* @author Yegor Bugayenko (yegor256@gmail.com)
* @version $Id$
* @since 1.0
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class TkRelay implements Take {

Expand Down Expand Up @@ -150,14 +152,14 @@ private static Request request(final Request req, final String path) {
return new Request() {
@Override
public Iterable<String> head() throws IOException {
return Iterables.concat(
return new ConcatIterable<String>(
Collections.singleton(
String.format(
"GET %s HTTP/1.1",
path
)
),
Iterables.skip(req.head(), 1)
new SkippedIterable<>(req.head(), 1)
);
}
@Override
Expand Down

0 comments on commit 57f7045

Please sign in to comment.