/**
 * Logspace
 * Copyright (c) 2015 Indoqa Software Design und Beratung GmbH. All rights reserved.
 * This program and the accompanying materials are made available under the terms of
 * the Eclipse Public License Version 1.0, which accompanies this distribution and
 * is available at http://www.eclipse.org/legal/epl-v10.html.
 */
package io.logspace.sample.service;

import io.logspace.agent.api.event.AbstractEventBuilder;
import io.logspace.agent.api.event.Optional;

/*default*/ class DateTimeUsageEventBuilder extends AbstractEventBuilder {

    private static final String TYPE = "date-time";

    private static final String PROPERTY_SERVICE_RESPONSE_TIME = "response_time";
    private static final String PROPERTY_TIMEZONE = "timezone";

    private Optional<String> type = Optional.of(TYPE);

    public DateTimeUsageEventBuilder(String agentId, String system) {
        super(agentId, system);
    }

    public DateTimeUsageEventBuilder addServiceResponseTime(final long responseTime) {
        this.addProperty(PROPERTY_SERVICE_RESPONSE_TIME, responseTime);
        return this;
    }

    public DateTimeUsageEventBuilder addTimeZone(final String timezone) {
        this.addProperty(PROPERTY_TIMEZONE, timezone);
        return this;
    }

    @Override
    protected Optional<String> getType() {
        return this.type;
    }
}

@@ -425,53 +425,8 @@
 der;
-%0Aimport io.logspace.agent.api.event.Optional;
 %0A%0A/*
@@ -703,64 +703,8 @@
 %22;%0A%0A
-    private Optional%3CString%3E type = Optional.of(TYPE);%0A%0A
     
@@ -798,16 +798,22 @@
 , system
+, null
 );%0A    %7D
@@ -1190,24 +1190,14 @@
 ted 
-Optional%3C
 String
-%3E
  get
@@ -1224,17 +1224,12 @@
 urn 
-this.type
+TYPE
 ;%0A  

align with the introduction of markers