Interface SerdeService


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

    Modifier and Type
    Method
    Description
    <T> T
    fromJson(String json, Class<T> type)
    Deserializes the given json blob into an object of type.
    <T> T
    mapTo(Object obj, Class<T> type)
    Attempts to map the given obj to the given type.
    <T> T
    mapTo(String pointer, Object obj, Class<T> type)
    Attempts to map the given obj at pointer to the given type.
    Serializes the given obj to a JSON string.
  • Method Details

    • toJson

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

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

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

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