Package dev.runabout

Interface RunaboutSerializer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface RunaboutSerializer
    Generic serializer interface for Runabout. This interface should be implemented once per project, and the implementation should be a catch-all for any objects that need a custom serializer, but do not contain an instance serializer method in their class. To learn more about how to implement an instance serializer, see ToRunabout. The implementation should return null if the serializer cannot create a valid RunaboutInput for the given object. For common types, consumers of the API can rely on the default serializer. See DefaultSerializer for details on which types are serialized out of the box. The implementation should be added to the RunaboutService via RunaboutServiceBuilder.setCustomSerializer(RunaboutSerializer) or registered as a service in the META-INF/services/dev.runabout.RunaboutSerializer file.
    • Method Detail

      • toRunaboutGeneric

        RunaboutInput toRunaboutGeneric​(java.lang.Object object)
        Converts an object to a RunaboutInput.
        Parameters:
        object - The object to serialize.
        Returns:
        A RunaboutInput containing a valid Java statement that can be used to recreate the object.