/*
 * Copyright 2019 The RoboZonky Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.robozonky.api.remote.entities;

import java.time.OffsetDateTime;
import java.util.Objects;
import javax.xml.bind.annotation.XmlElement;

import com.github.robozonky.internal.util.DateUtil;

public class LastPublishedLoan extends BaseEntity {

    @XmlElement
    private int id;
    @XmlElement
    private OffsetDateTime datePublished;

    public LastPublishedLoan(final int loanId) {
        this(loanId, DateUtil.offsetNow());
    }

    public LastPublishedLoan(final int loanId, final OffsetDateTime datePublished) {
        this.id = loanId;
        this.datePublished = datePublished;
    }

    public int getId() {
        return id;
    }

    public OffsetDateTime getDatePublished() {
        return datePublished;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || !Objects.equals(getClass(), o.getClass())) {
            return false;
        }
        final LastPublishedLoan that = (LastPublishedLoan) o;
        return id == that.id &&
                Objects.equals(datePublished, that.datePublished);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, datePublished);
    }
}

@@ -861,32 +861,16 @@
 tity %7B%0A%0A
-    @XmlElement%0A
     priv
@@ -885,24 +885,8 @@
 id;%0A
-    @XmlElement%0A
     
@@ -924,16 +924,69 @@
 ished;%0A%0A
+    LastPublishedLoan() %7B%0A        // for JAXB%0A    %7D%0A%0A
     publ
@@ -1231,32 +1231,48 @@
 blished;%0A    %7D%0A%0A
+    @XmlElement%0A
     public int g
@@ -1298,32 +1298,48 @@
 turn id;%0A    %7D%0A%0A
+    @XmlElement%0A
     public Offse

Add noarg constructor to fix JAXB