class ImmutableLogEntry implements LogEntry {

    @Override
    public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> predicate) {
        final JsonObjectBuilder builder = JsonFactory.newObjectBuilder()
                .set(JsonFields.CORRELATION_ID, correlationId)
                .set(JsonFields.TIMESTAMP, timestamp.toString())
                .set(JsonFields.CATEGORY, logCategory.getName())
                .set(JsonFields.TYPE, logType.getType())
                .set(JsonFields.LEVEL, logLevel.getLevel())
                .set(JsonFields.MESSAGE, message);
        if (null != address) {
            builder.set(JsonFields.ADDRESS, address);
        }
        if (null != thingId) {
            builder.set(JsonFields.THING_ID, thingId.toString());
        }
        return builder.build();
    }

    private  ImmutableLogEntry(final Builder builder);

}