File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
src/main/kotlin/com/github/leviysoft/sk Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ The following components of `scala.jdk` are implemented:
1414- [x] DurationConverters
1515- [ ] FunctionConverters
1616- [x] FutureConverters
17- - [ ] OptionConverters
17+ - [x ] OptionConverters
1818- [ ] StreamConverters
1919
Original file line number Diff line number Diff line change 1+ package com.github.leviysoft.sk
2+
3+ import scala.Option
4+ import java.util.*
5+
6+ fun <T > Option<T>.toJava (): Optional <T > {
7+ return scala.jdk.javaapi.OptionConverters .toJava(this )
8+ }
9+
10+ fun Option<Double>.toJavaOptionalDouble (): OptionalDouble {
11+ return scala.jdk.javaapi.OptionConverters .toJavaOptionalDouble(this )
12+ }
13+
14+ fun Option<Int>.toJavaOptionalInt (): OptionalInt {
15+ return scala.jdk.javaapi.OptionConverters .toJavaOptionalInt(this )
16+ }
17+
18+ fun Option<Long>.toJavaOptionalLong (): OptionalLong {
19+ return scala.jdk.javaapi.OptionConverters .toJavaOptionalLong(this )
20+ }
21+
22+ fun <T > Optional<T>.toScala (): Option <T > {
23+ return scala.jdk.javaapi.OptionConverters .toScala(this )
24+ }
25+
26+ fun OptionalDouble.toScala (): Option <Double > {
27+ return scala.jdk.javaapi.OptionConverters .toScala(this )
28+ }
29+
30+ fun OptionalInt.toScala (): Option <Int > {
31+ return scala.jdk.javaapi.OptionConverters .toScala(this )
32+ }
33+
34+ fun OptionalLong.toScala (): Option <Long > {
35+ return scala.jdk.javaapi.OptionConverters .toScala(this )
36+ }
You can’t perform that action at this time.
0 commit comments