Interface SerdeService
-
@Beta public interface SerdeServiceProvides utility methods into Spinnaker's standard internal serialization libraries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TfromJson(java.lang.String json, java.lang.Class<T> type)Deserializes the givenjsonblob into an object oftype.<T> TmapTo(java.lang.Object obj, java.lang.Class<T> type)Attempts to map the givenobjto the giventype.<T> TmapTo(java.lang.String pointer, java.lang.Object obj, java.lang.Class<T> type)Attempts to map the givenobjatpointerto the giventype.java.lang.StringtoJson(java.lang.Object obj)Serializes the givenobjto a JSON string.
-
-
-
Method Detail
-
toJson
@Nonnull java.lang.String toJson(@Nonnull java.lang.Object obj)Serializes the givenobjto a JSON string.
-
fromJson
@Nonnull <T> T fromJson(@Nonnull java.lang.String json, @Nonnull java.lang.Class<T> type)Deserializes the givenjsonblob into an object oftype.
-
mapTo
@Nonnull <T> T mapTo(@Nonnull java.lang.Object obj, @Nonnull java.lang.Class<T> type)Attempts to map the givenobjto the giventype.
-
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 givenobjatpointerto the giventype.- Parameters:
pointer- Must be a JSONPath-compatible pointer
-
-