Interface IMapper

All Known Implementing Classes:
ReSMSMapper

public interface IMapper
An interface for mapping between JSON representation and Java objects using Moshi.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    fromJson(String value, Class<T> clazz)
    Converts the provided JSON value into an instance of the specified class.
    toJson(Object object)
    Converts the provided object into its JSON representation.
  • Method Details

    • toJson

      String toJson(Object object)
      Converts the provided object into its JSON representation.
      Parameters:
      object - The object to be converted to JSON.
      Returns:
      The JSON representation of the object.
    • fromJson

      <T> T fromJson(String value, Class<T> clazz)
      Converts the provided JSON value into an instance of the specified class.
      Type Parameters:
      T - The type of the resulting object.
      Parameters:
      value - The JSON value to be converted.
      clazz - The class to convert the JSON value to.
      Returns:
      An instance of the specified class with values from the JSON value.