package com.google.cloud.solutions;

import org.joda.time.Instant;

class LogEntry {
    private Instant timestamp;
    private int httpStatusCode;
    private double responseTime;
    private String source;
    private String httpMethod;
    private String destination;

    public LogEntry(Instant timestamp, int httpStatusCode, double responseTime,
                    String source, String httpMethod, String destination) {
        this.timestamp = timestamp;
        this.httpStatusCode = httpStatusCode;
        this.responseTime = responseTime;
        this.source = source;
        this.httpMethod = httpMethod;
        this.destination = destination;
    }

    public Instant getTimestamp() {
        return timestamp;
    }

    public int getHttpStatusCode() {
        return httpStatusCode;
    }

    public double getResponseTime() {
        return responseTime;
    }

    public String getSource() {
        return source;
    }

    public String getHttpMethod() {
        return httpMethod;
    }

    public String getDestination() {
        return destination;
    }
}

package com.google.cloud.solutions;

import com.google.cloud.dataflow.sdk.coders.AvroCoder;
import com.google.cloud.dataflow.sdk.coders.DefaultCoder;
import org.apache.avro.reflect.Nullable;
import org.joda.time.Instant;

@DefaultCoder(AvroCoder.class)
class LogEntry {
    @Nullable private Instant timestamp;
    @Nullable private int httpStatusCode;
    @Nullable private double responseTime;
    @Nullable private String source;
    @Nullable private String httpMethod;
    @Nullable private String destination;

    public LogEntry(Instant timestamp, int httpStatusCode, double responseTime,
                    String source, String httpMethod, String destination) {
        this.timestamp = timestamp;
        this.httpStatusCode = httpStatusCode;
        this.responseTime = responseTime;
        this.source = source;
        this.httpMethod = httpMethod;
        this.destination = destination;
    }

    public Instant getTimestamp() {
        return this.timestamp;
    }

    public int getHttpStatusCode() {
        return this.httpStatusCode;
    }

    public double getResponseTime() {
        return this.responseTime;
    }

    public String getSource() {
        return this.source;
    }

    public String getHttpMethod() {
        return this.httpMethod;
    }

    public String getDestination() {
        return this.destination;
    }
}

set DefaultCoder to AvroCoder