001
002package com.commercetools.api.models.error;
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 *  <p>Returned when the API Extension does not respond within the time limit, or could not be reached.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class GraphQLExtensionNoResponseErrorImpl implements GraphQLExtensionNoResponseError, ModelBase {
022
023    private String code;
024
025    private Map<String, java.lang.Object> values;
026
027    private String extensionId;
028
029    private String extensionKey;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    GraphQLExtensionNoResponseErrorImpl(@JsonProperty("values") final Map<String, java.lang.Object> values,
036            @JsonProperty("extensionId") final String extensionId,
037            @JsonProperty("extensionKey") final String extensionKey) {
038        this.values = values;
039        this.extensionId = extensionId;
040        this.extensionKey = extensionKey;
041        this.code = EXTENSION_NO_RESPONSE;
042    }
043
044    /**
045     * create empty instance
046     */
047    public GraphQLExtensionNoResponseErrorImpl() {
048        this.code = EXTENSION_NO_RESPONSE;
049    }
050
051    /**
052     *
053     */
054
055    public String getCode() {
056        return this.code;
057    }
058
059    /**
060     *  <p>Error-specific additional fields.</p>
061     */
062
063    public Map<String, java.lang.Object> values() {
064        return values;
065    }
066
067    /**
068     *  <p>Unique identifier of the API Extension.</p>
069     */
070
071    public String getExtensionId() {
072        return this.extensionId;
073    }
074
075    /**
076     *  <p>User-defined unique identifier of the API Extension, if available.</p>
077     */
078
079    public String getExtensionKey() {
080        return this.extensionKey;
081    }
082
083    public void setValue(String key, java.lang.Object value) {
084        if (values == null) {
085            values = new HashMap<>();
086        }
087        values.put(key, value);
088    }
089
090    public void setExtensionId(final String extensionId) {
091        this.extensionId = extensionId;
092    }
093
094    public void setExtensionKey(final String extensionKey) {
095        this.extensionKey = extensionKey;
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        GraphQLExtensionNoResponseErrorImpl that = (GraphQLExtensionNoResponseErrorImpl) o;
107
108        return new EqualsBuilder().append(code, that.code)
109                .append(values, that.values)
110                .append(extensionId, that.extensionId)
111                .append(extensionKey, that.extensionKey)
112                .append(code, that.code)
113                .append(values, that.values)
114                .append(extensionId, that.extensionId)
115                .append(extensionKey, that.extensionKey)
116                .isEquals();
117    }
118
119    @Override
120    public int hashCode() {
121        return new HashCodeBuilder(17, 37).append(code)
122                .append(values)
123                .append(extensionId)
124                .append(extensionKey)
125                .toHashCode();
126    }
127
128}