Skip to content

Commit 0516ab0

Browse files
committed
rename Routes.mapper() to Routes.map() fix #385
1 parent e727b7e commit 0516ab0

9 files changed

Lines changed: 17 additions & 17 deletions

File tree

coverage-report/src/test/java/org/jooby/assets/AssetsBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public List<Object> list(final Object... args) {
1717
return Arrays.asList(args);
1818
}
1919

20-
public Map<String, Object> map(final Object... args) {
20+
public Map<String, Object> hash(final Object... args) {
2121
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
2222
for (int i = 0; i < args.length; i += 2) {
2323
builder.put(args[i].toString(), args[i + 1]);
@@ -27,6 +27,6 @@ public Map<String, Object> map(final Object... args) {
2727

2828
public Config assets(final String dist, final Object... args) {
2929
return ConfigFactory.empty()
30-
.withValue("assets", ConfigValueFactory.fromMap(map(args)));
30+
.withValue("assets", ConfigValueFactory.fromMap(hash(args)));
3131
}
3232
}

coverage-report/src/test/java/org/jooby/assets/NoPipelineFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class NoPipelineFeature extends AssetsBase {
99
{
1010

1111
use(assets("dev", "basedir", "org/jooby/assets", "fileset",
12-
map("home", list("js/index.js", "css/index.css")), "watch", false));
12+
hash("home", list("js/index.js", "css/index.css")), "watch", false));
1313

1414
use(new Hbs("/org/jooby/assets"));
1515
use(new Assets());

coverage-report/src/test/java/org/jooby/issues/Issue367.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
public class Issue367 extends ServerFeature {
1212

1313
{
14-
mapper(Rx.rx());
14+
map(Rx.rx());
1515

16-
mapper(Reactor.reactor());
16+
map(Reactor.reactor());
1717

1818
get("/rx", () -> Observable.just("reactive"));
1919

coverage-report/src/test/java/org/jooby/issues/Issue384a.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public class Issue384a extends ServerFeature {
88

99
{
1010

11-
mapper(Route.Mapper.create("counter", (final Integer v) -> v + 1));
12-
mapper(Route.Mapper.create("counter", (final Integer v) -> v + 1));
11+
map(Route.Mapper.create("counter", (final Integer v) -> v + 1));
12+
map(Route.Mapper.create("counter", (final Integer v) -> v + 1));
1313

1414
get("/counter", () -> 1);
1515
}

coverage-report/src/test/java/org/jooby/issues/Issue384b.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ public class Issue384b extends ServerFeature {
77

88
{
99

10-
mapper(((final Integer value) -> value * 2));
10+
map(((final Integer value) -> value * 2));
1111

12-
mapper((v -> Integer.parseInt(v.toString())));
12+
map((v -> Integer.parseInt(v.toString())));
1313

1414
get("/4", () -> {
1515
return "2";

jooby-mongodb-rx/src/main/java/org/jooby/mongodb/MongoRx.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ public void configure(final Env env, final Config conf, final Binder binder) {
389389

390390
/** mapper */
391391
env.routes()
392-
.mapper(Rx.rx())
393-
.mapper(mapper());
392+
.map(Rx.rx())
393+
.map(mapper());
394394

395395
log.info("Started {}", cstr);
396396

jooby-mongodb-rx/src/test/java/org/jooby/mongodb/MongodbRxTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public class MongodbRxTest {
108108
expect(Rx.rx()).andReturn(rx);
109109

110110
Routes routes = unit.mock(Routes.class);
111-
expect(routes.mapper(rx)).andReturn(routes);
112-
expect(routes.mapper(unit.capture(Route.Mapper.class))).andReturn(routes);
111+
expect(routes.map(rx)).andReturn(routes);
112+
expect(routes.map(unit.capture(Route.Mapper.class))).andReturn(routes);
113113

114114
Env env = unit.get(Env.class);
115115
expect(env.routes()).andReturn(routes);

jooby/src/main/java/org/jooby/Jooby.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3551,7 +3551,7 @@ public void start(final String[] args, final Consumer<List<Route.Definition>> ro
35513551

35523552
@Override
35533553
@SuppressWarnings("unchecked")
3554-
public Jooby mapper(final Mapper<?> mapper) {
3554+
public Jooby map(final Mapper<?> mapper) {
35553555
requireNonNull(mapper, "Mapper is required.");
35563556
if (mappers.add(mapper.name())) {
35573557
this.mapper = Optional.ofNullable(this.mapper)

jooby/src/main/java/org/jooby/Routes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,12 +2477,12 @@ Route.Collection complete(String method, String pattern, Route.Complete handler,
24772477
* }
24782478
* }</pre>
24792479
*
2480-
* A call to <code>/four</code> outputs <code>4</code>
2480+
* A call to <code>/four</code> outputs <code>4</code>.
24812481
*
2482-
* @param mapper
2482+
* @param mapper Route mapper to append.
24832483
* @return This instance.
24842484
*/
2485-
Routes mapper(final Mapper<?> mapper);
2485+
Routes map(final Mapper<?> mapper);
24862486

24872487
/**
24882488
* Setup a route error handler. Default error handler {@link Err.DefHandler} does content

0 commit comments

Comments
 (0)