All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cl.transbank.util.JsonUtil Maven / Gradle / Ivy

The newest version!
package cl.transbank.util;

import java.util.List;

/**
 * This interface provides methods for JSON encoding and decoding.
 */
public interface JsonUtil {
  /**
   * Encodes an object into a JSON string.
   * @param o The object to encode.
   * @return The JSON string.
   */
  String jsonEncode(Object o);

  /**
   * Decodes a JSON string into an object of the specified class.
   * @param json The JSON string.
   * @param clazz The class of the object.
   * @param  The type of the object.
   * @return The decoded object.
   */
   T jsonDecode(String json, Class clazz);

  /**
   * Decodes a JSON string into a list of objects of the specified class.
   * @param json The JSON string.
   * @param clazz The class of the objects.
   * @param  The type of the objects.
   * @return The list of decoded objects.
   */
   List jsonDecodeToList(String json, Class clazz);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy