// Path: example/src/main/java/com/softwaremill/example/SomeJavaComplexObject.java
// public class SomeJavaComplexObject {
// 
//     private final String value;
// 
//     public SomeJavaComplexObject(String value) {
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionSerializers.java
// public final class SessionSerializers {
// 
//     public static final SessionSerializer<String, String> StringToStringSessionSerializer = SessionSerializer$.MODULE$.stringToStringSessionSerializer();
//     public static final SessionSerializer<Integer, String> IntToStringSessionSerializer = (SessionSerializer<Integer, String>) (SessionSerializer) SessionSerializer$.MODULE$.intToStringSessionSerializer();
//     public static final SessionSerializer<Long, String> LongToStringSessionSerializer = (SessionSerializer<Long, String>) (SessionSerializer) SessionSerializer$.MODULE$.longToStringSessionSerializer();
//     public static final SessionSerializer<Float, String> FloatToStringSessionSerializer = (SessionSerializer<Float, String>) (SessionSerializer) SessionSerializer$.MODULE$.floatToStringSessionSerializer();
//     public static final SessionSerializer<Double, String> DoubleToStringSessionSerializer = (SessionSerializer<Double, String>) (SessionSerializer) SessionSerializer$.MODULE$.doubleToStringSessionSerializer();
// 
//     public static final SessionSerializer<Map<String, String>, String> MapToStringSessionSerializer = new MultiValueSessionSerializer<>(
//         (JFunction1<Map<String, String>, scala.collection.immutable.Map<String, String>>) m -> MapConverters.toImmutableMap(m),
//         (JFunction1<scala.collection.immutable.Map<String, String>, Try<Map<String, String>>>) v1 ->
//             Try.apply((JFunction0<Map<String, String>>) () -> JavaConverters.mapAsJavaMapConverter(v1).asJava())
//     );
// 
//     private SessionSerializers() {
//     }
// 
// }


import com.softwaremill.example.SomeJavaComplexObject;
import com.softwaremill.session.SessionSerializer;
import com.softwaremill.session.SingleValueSessionSerializer;
import com.softwaremill.session.javadsl.SessionSerializers;
import scala.Function1;
import scala.compat.java8.JFunction0;
import scala.compat.java8.JFunction1;
import scala.util.Try;
package com.softwaremill.example.serializers;


public class MyJavaSingleSessionSerializer extends SingleValueSessionSerializer<SomeJavaComplexObject, String> {

    public MyJavaSingleSessionSerializer(
        Function1<SomeJavaComplexObject, String> toValue,
        Function1<String, Try<SomeJavaComplexObject>> fromValue,
        SessionSerializer<String, String> valueSerializer
    ) {
        super(toValue, fromValue, valueSerializer);
    }

    public static void main(String[] args) {
        new MyJavaSingleSessionSerializer(
            (JFunction1<SomeJavaComplexObject, String>) SomeJavaComplexObject::getValue,
            (JFunction1<String, Try<SomeJavaComplexObject>>) value -> Try.apply((JFunction0<SomeJavaComplexObject>) () -> new SomeJavaComplexObject(value)),
// Path: example/src/main/java/com/softwaremill/example/SomeJavaComplexObject.java
// public class SomeJavaComplexObject {
// 
//     private final String value;
// 
//     public SomeJavaComplexObject(String value) {
//         this.value = value;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionSerializers.java
// public final class SessionSerializers {
// 
//     public static final SessionSerializer<String, String> StringToStringSessionSerializer = SessionSerializer$.MODULE$.stringToStringSessionSerializer();
//     public static final SessionSerializer<Integer, String> IntToStringSessionSerializer = (SessionSerializer<Integer, String>) (SessionSerializer) SessionSerializer$.MODULE$.intToStringSessionSerializer();
//     public static final SessionSerializer<Long, String> LongToStringSessionSerializer = (SessionSerializer<Long, String>) (SessionSerializer) SessionSerializer$.MODULE$.longToStringSessionSerializer();
//     public static final SessionSerializer<Float, String> FloatToStringSessionSerializer = (SessionSerializer<Float, String>) (SessionSerializer) SessionSerializer$.MODULE$.floatToStringSessionSerializer();
//     public static final SessionSerializer<Double, String> DoubleToStringSessionSerializer = (SessionSerializer<Double, String>) (SessionSerializer) SessionSerializer$.MODULE$.doubleToStringSessionSerializer();
// 
//     public static final SessionSerializer<Map<String, String>, String> MapToStringSessionSerializer = new MultiValueSessionSerializer<>(
//         (JFunction1<Map<String, String>, scala.collection.immutable.Map<String, String>>) m -> MapConverters.toImmutableMap(m),
//         (JFunction1<scala.collection.immutable.Map<String, String>, Try<Map<String, String>>>) v1 ->
//             Try.apply((JFunction0<Map<String, String>>) () -> JavaConverters.mapAsJavaMapConverter(v1).asJava())
//     );
// 
//     private SessionSerializers() {
//     }
// 
// }


// Path: example/src/main/java/com/softwaremill/example/serializers/MyJavaSingleSessionSerializer.java
import com.softwaremill.example.SomeJavaComplexObject;
import com.softwaremill.session.SessionSerializer;
import com.softwaremill.session.SingleValueSessionSerializer;
import com.softwaremill.session.javadsl.SessionSerializers;
import scala.Function1;
import scala.compat.java8.JFunction0;
import scala.compat.java8.JFunction1;
import scala.util.Try;

package com.softwaremill.example.serializers;


public class MyJavaSingleSessionSerializer extends SingleValueSessionSerializer<SomeJavaComplexObject, String> {

    public MyJavaSingleSessionSerializer(
        Function1<SomeJavaComplexObject, String> toValue,
        Function1<String, Try<SomeJavaComplexObject>> fromValue,
        SessionSerializer<String, String> valueSerializer
    ) {
        super(toValue, fromValue, valueSerializer);
    }

    public static void main(String[] args) {
        new MyJavaSingleSessionSerializer(
            (JFunction1<SomeJavaComplexObject, String>) SomeJavaComplexObject::getValue,
            (JFunction1<String, Try<SomeJavaComplexObject>>) value -> Try.apply((JFunction0<SomeJavaComplexObject>) () -> new SomeJavaComplexObject(value)),
            SessionSerializers.StringToStringSessionSerializer