Interface SerdeService


  • @Beta
    public interface SerdeService
    Provides utility methods into Spinnaker's standard internal serialization libraries.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T fromJson​(java.lang.String json, java.lang.Class<T> type)
      Deserializes the given json blob into an object of type.
      <T> T mapTo​(java.lang.Object obj, java.lang.Class<T> type)
      Attempts to map the given obj to the given type.
      <T> T mapTo​(java.lang.String pointer, java.lang.Object obj, java.lang.Class<T> type)
      Attempts to map the given obj at pointer to the given type.
      java.lang.String toJson​(java.lang.Object obj)
      Serializes the given obj to a JSON string.
    • Method Detail

      • toJson

        @Nonnull
        java.lang.String toJson​(@Nonnull
                                java.lang.Object obj)
        Serializes the given obj to a JSON string.
      • fromJson

        @Nonnull
        <T> T fromJson​(@Nonnull
                       java.lang.String json,
                       @Nonnull
                       java.lang.Class<T> type)
        Deserializes the given json blob into an object of type.
      • mapTo

        @Nonnull
        <T> T mapTo​(@Nonnull
                    java.lang.Object obj,
                    @Nonnull
                    java.lang.Class<T> type)
        Attempts to map the given obj to the given type.
      • mapTo

        @Nonnull
        <T> T mapTo​(@Nullable
                    java.lang.String pointer,
                    @Nonnull
                    java.lang.Object obj,
                    @Nonnull
                    java.lang.Class<T> type)
        Attempts to map the given obj at pointer to the given type.
        Parameters:
        pointer - Must be a JSONPath-compatible pointer