回答編集履歴
4
誤字
test
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
---
|
8
8
|
|
9
9
|
```kotlin
|
10
|
-
class RepoAdapter(private val repos: List<Repo>, private val consumer: (URL) ->
|
10
|
+
class RepoAdapter(private val repos: List<Repo>, private val consumer: (URL) -> Unit)
|
11
11
|
```
|
3
修正
test
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
---
|
8
8
|
|
9
9
|
```kotlin
|
10
|
-
class RepoAdapter(private val repos: List<Repo>, private val consumer: URL -> unit)
|
10
|
+
class RepoAdapter(private val repos: List<Repo>, private val consumer: (URL) -> unit)
|
11
11
|
```
|
2
kotlin ならこうかな?
test
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
パッと見だけですが、 repos が URL ならこんなでしょうか。
|
2
2
|
```java
|
3
|
-
public RepoAdapter(URL repos, Consumer<URL> consumer) {
|
3
|
+
public RepoAdapter(List<URL> repos, Consumer<URL> consumer) {
|
4
4
|
```
|
5
5
|
あ、 java.util.function.Consumer を import してください。
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
```kotlin
|
10
|
+
class RepoAdapter(private val repos: List<Repo>, private val consumer: URL -> unit)
|
11
|
+
```
|
1
追記
test
CHANGED
@@ -2,3 +2,4 @@
|
|
2
2
|
```java
|
3
3
|
public RepoAdapter(URL repos, Consumer<URL> consumer) {
|
4
4
|
```
|
5
|
+
あ、 java.util.function.Consumer を import してください。
|