public JsonElement serialize()

in src/main/java/com/googlesource/gerrit/plugins/auditsl4j/AuditRendererToJson.java [77:92]


        public JsonElement serialize(
            CurrentUser user, Type typeOfSrc, JsonSerializationContext context) {
          JsonObject jsonUser = new JsonObject();

          jsonUser.addProperty("access_path", user.getAccessPath().name());
          jsonUser.addProperty("name", user.getLoggableName());
          jsonUser.addProperty("internal_user", user.isInternalUser());
          jsonUser.addProperty("identified_user", user.isIdentifiedUser());
          jsonUser.addProperty("impersonating", user.isImpersonating());

          if (user.isIdentifiedUser()) {
            jsonUser.addProperty("account_id", user.asIdentifiedUser().getAccountId().get());
          }

          return jsonUser;
        }