SettingsManager.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:GDSC-SMLM 作者:
/**
 * Write the message to a JSON string.
 *
 * @param message
 *            the message
 * @param flags
 *            the flags
 * @return the JSON string
 */
public static boolean toJSON(MessageOrBuilder message, Appendable output, int flags)
{
    try
    {
        if (printer == null)
            printer = JsonFormat.printer();
        Printer p = printer;
        if (BitFlags.anyNotSet(flags, FLAG_JSON_WHITESPACE))
            p = p.omittingInsignificantWhitespace();
        if (BitFlags.anySet(flags, FLAG_JSON_DEFAULT_VALUES))
            p = p.includingDefaultValueFields();
        p.appendTo(message, output);
        return true;
    }
    catch (IOException e)
    {
        if (BitFlags.anyNotSet(flags, FLAG_SILENT))
            IJ.log("Unable to write message: " + e.getMessage());
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号