001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 * Reservation
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ReservationImpl implements Reservation, ModelBase {
022
023    private Integer quantity;
024
025    private com.commercetools.history.models.common.Reference owner;
026
027    private String createdAt;
028
029    private String checkoutStartedAt;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    ReservationImpl(@JsonProperty("quantity") final Integer quantity,
036            @JsonProperty("owner") final com.commercetools.history.models.common.Reference owner,
037            @JsonProperty("createdAt") final String createdAt,
038            @JsonProperty("checkoutStartedAt") final String checkoutStartedAt) {
039        this.quantity = quantity;
040        this.owner = owner;
041        this.createdAt = createdAt;
042        this.checkoutStartedAt = checkoutStartedAt;
043    }
044
045    /**
046     * create empty instance
047     */
048    public ReservationImpl() {
049    }
050
051    /**
052     *
053     */
054
055    public Integer getQuantity() {
056        return this.quantity;
057    }
058
059    /**
060     *
061     */
062
063    public com.commercetools.history.models.common.Reference getOwner() {
064        return this.owner;
065    }
066
067    /**
068     *
069     */
070
071    public String getCreatedAt() {
072        return this.createdAt;
073    }
074
075    /**
076     *
077     */
078
079    public String getCheckoutStartedAt() {
080        return this.checkoutStartedAt;
081    }
082
083    public void setQuantity(final Integer quantity) {
084        this.quantity = quantity;
085    }
086
087    public void setOwner(final com.commercetools.history.models.common.Reference owner) {
088        this.owner = owner;
089    }
090
091    public void setCreatedAt(final String createdAt) {
092        this.createdAt = createdAt;
093    }
094
095    public void setCheckoutStartedAt(final String checkoutStartedAt) {
096        this.checkoutStartedAt = checkoutStartedAt;
097    }
098
099    @Override
100    public boolean equals(Object o) {
101        if (this == o)
102            return true;
103
104        if (o == null || getClass() != o.getClass())
105            return false;
106
107        ReservationImpl that = (ReservationImpl) o;
108
109        return new EqualsBuilder().append(quantity, that.quantity)
110                .append(owner, that.owner)
111                .append(createdAt, that.createdAt)
112                .append(checkoutStartedAt, that.checkoutStartedAt)
113                .append(quantity, that.quantity)
114                .append(owner, that.owner)
115                .append(createdAt, that.createdAt)
116                .append(checkoutStartedAt, that.checkoutStartedAt)
117                .isEquals();
118    }
119
120    @Override
121    public int hashCode() {
122        return new HashCodeBuilder(17, 37).append(quantity)
123                .append(owner)
124                .append(createdAt)
125                .append(checkoutStartedAt)
126                .toHashCode();
127    }
128
129}