001
002package com.commercetools.api.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 * BaseResource
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class BaseResourceImpl implements BaseResource, ModelBase {
022
023    private String id;
024
025    private Long version;
026
027    private java.time.ZonedDateTime createdAt;
028
029    private java.time.ZonedDateTime lastModifiedAt;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    BaseResourceImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version,
036            @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt,
037            @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt) {
038        this.id = id;
039        this.version = version;
040        this.createdAt = createdAt;
041        this.lastModifiedAt = lastModifiedAt;
042    }
043
044    /**
045     * create empty instance
046     */
047    public BaseResourceImpl() {
048    }
049
050    /**
051     *
052     */
053
054    public String getId() {
055        return this.id;
056    }
057
058    /**
059     *
060     */
061
062    public Long getVersion() {
063        return this.version;
064    }
065
066    /**
067     *
068     */
069
070    public java.time.ZonedDateTime getCreatedAt() {
071        return this.createdAt;
072    }
073
074    /**
075     *
076     */
077
078    public java.time.ZonedDateTime getLastModifiedAt() {
079        return this.lastModifiedAt;
080    }
081
082    public void setId(final String id) {
083        this.id = id;
084    }
085
086    public void setVersion(final Long version) {
087        this.version = version;
088    }
089
090    public void setCreatedAt(final java.time.ZonedDateTime createdAt) {
091        this.createdAt = createdAt;
092    }
093
094    public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) {
095        this.lastModifiedAt = lastModifiedAt;
096    }
097
098    @Override
099    public boolean equals(Object o) {
100        if (this == o)
101            return true;
102
103        if (o == null || getClass() != o.getClass())
104            return false;
105
106        BaseResourceImpl that = (BaseResourceImpl) o;
107
108        return new EqualsBuilder().append(id, that.id)
109                .append(version, that.version)
110                .append(createdAt, that.createdAt)
111                .append(lastModifiedAt, that.lastModifiedAt)
112                .isEquals();
113    }
114
115    @Override
116    public int hashCode() {
117        return new HashCodeBuilder(17, 37).append(id)
118                .append(version)
119                .append(createdAt)
120                .append(lastModifiedAt)
121                .toHashCode();
122    }
123
124}