com.revinate.ship.result.GuestStayListResult Maven / Gradle / Ivy
package com.revinate.ship.result;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GuestStayListResult extends Result {
@Valid
private Summary summary;
@Valid
private List guestStays;
@Valid
@Deprecated
private List errors;
@Valid
@Deprecated
private List warnings;
public void addGuestStay(GuestStayResult guestStay) {
if (Objects.isNull(this.guestStays)) {
this.guestStays = new ArrayList<>();
}
this.guestStays.add(guestStay);
}
public void addGuestStays(Collection extends GuestStayResult> guestStays) {
if (Objects.isNull(this.guestStays)) {
this.guestStays = new ArrayList<>();
}
this.guestStays.addAll(guestStays);
}
@Override
public String toString() {
return summary.toString();
}
}