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

com.mailgun.util.StringUtil Maven / Gradle / Ivy

Go to download

The Mailgun SDK for Java enables Java developers to work with Mailgun API efficiently.

There is a newer version: 1.1.3
Show newest version
package com.mailgun.util;

import com.mailgun.exception.MailGunException;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@UtilityClass
public class StringUtil {

    /**
     * 

* Method that can be used to serialize any Java value as a String. *

* * @param obj any Java value * @return serialized result */ public String asJsonString(final Object obj) { try { return ObjectMapperUtil.getObjectMapper().writeValueAsString(obj); } catch (Exception e) { log.error("Unable to serialize object.", e); throw new MailGunException("Unable to serialize object."); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy