private <T> String format(final T t,
                              final IClassContainer container,
                              final Mode mode) {
        final List<ExportContainer> exportContainers = extractExportContainers(t, container);

        final String fieldTabs = buildFieldTab(mode);

        final String openValueTag = buildOpenTag(mode);
        final String closeValueTag = buildCloseTag(mode);
        final String valueDelimiter = (isPretty) ? ",\n" : ",";

        final StringBuilder builder = new StringBuilder(openValueTag);

        final String valueResult = exportContainers.stream()
                .map(c -> fieldTabs + wrapWithQuotes(c.getExportName()) + ":" + wrapWithQuotes(c, container))
                .collect(Collectors.joining(valueDelimiter));

        builder.append(valueResult)
                .append(closeValueTag);

        return builder.toString();
    }
private < T > String format ( final T t , final IClassContainer container , final Mode mode ) { final List < ExportContainer > exportContainers = extractExportContainers ( t , container ) ; final String fieldTabs = buildFieldTab ( mode ) ; final String openValueTag = buildOpenTag ( mode ) ; final String closeValueTag = buildCloseTag ( mode ) ; final String valueDelimiter = ( isPretty ) ? ",\n" : "," ; final StringBuilder builder = new StringBuilder ( openValueTag ) ; final String valueResult = exportContainers . stream ( ) . map ( c -> fieldTabs + wrapWithQuotes ( c . getExportName ( ) ) + ":" + wrapWithQuotes ( c , container ) ) . collect ( Collectors . joining ( valueDelimiter ) ) ; builder . append ( valueResult ) . append ( closeValueTag ) ; return builder . toString ( ) ; }
Format single T value to JSON format

@param mode represent Single JSON object or List of objects