class AdapterMetaDataConverter {

    public String convertToJSONOrNull(AdapterMetaData metaData) {
        if (metaData==null) {
            return null;
        }
        try {
            return JSONAdapterSupport.FOR_UNKNOWN_ADAPTER.toJSON(metaData);
        } catch (AdapterException e) {
            LOG.error("Not able to convert to metadata string:{}",metaData, e);
            return null;
        }
    }

}