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 ExtensionNoResponseErrorImpl implements ExtensionNoResponseError, ModelBase { 022 023 private String code; 024 025 private String message; 026 027 private Map<String, java.lang.Object> values; 028 029 private String extensionId; 030 031 private String extensionKey; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 ExtensionNoResponseErrorImpl(@JsonProperty("message") final String message, 038 @JsonProperty("values") final Map<String, java.lang.Object> values, 039 @JsonProperty("extensionId") final String extensionId, 040 @JsonProperty("extensionKey") final String extensionKey) { 041 this.message = message; 042 this.values = values; 043 this.extensionId = extensionId; 044 this.extensionKey = extensionKey; 045 this.code = EXTENSION_NO_RESPONSE; 046 } 047 048 /** 049 * create empty instance 050 */ 051 public ExtensionNoResponseErrorImpl() { 052 this.code = EXTENSION_NO_RESPONSE; 053 } 054 055 /** 056 * 057 */ 058 059 public String getCode() { 060 return this.code; 061 } 062 063 /** 064 * <p><code>"Extension did not respond in time."</code></p> 065 */ 066 067 public String getMessage() { 068 return this.message; 069 } 070 071 /** 072 * <p>Error-specific additional fields.</p> 073 */ 074 075 public Map<String, java.lang.Object> values() { 076 return values; 077 } 078 079 /** 080 * <p>Unique identifier of the API Extension.</p> 081 */ 082 083 public String getExtensionId() { 084 return this.extensionId; 085 } 086 087 /** 088 * <p>User-defined unique identifier of the API Extension, if available.</p> 089 */ 090 091 public String getExtensionKey() { 092 return this.extensionKey; 093 } 094 095 public void setMessage(final String message) { 096 this.message = message; 097 } 098 099 public void setValue(String key, java.lang.Object value) { 100 if (values == null) { 101 values = new HashMap<>(); 102 } 103 values.put(key, value); 104 } 105 106 public void setExtensionId(final String extensionId) { 107 this.extensionId = extensionId; 108 } 109 110 public void setExtensionKey(final String extensionKey) { 111 this.extensionKey = extensionKey; 112 } 113 114 @Override 115 public boolean equals(Object o) { 116 if (this == o) 117 return true; 118 119 if (o == null || getClass() != o.getClass()) 120 return false; 121 122 ExtensionNoResponseErrorImpl that = (ExtensionNoResponseErrorImpl) o; 123 124 return new EqualsBuilder().append(code, that.code) 125 .append(message, that.message) 126 .append(values, that.values) 127 .append(extensionId, that.extensionId) 128 .append(extensionKey, that.extensionKey) 129 .append(code, that.code) 130 .append(message, that.message) 131 .append(values, that.values) 132 .append(extensionId, that.extensionId) 133 .append(extensionKey, that.extensionKey) 134 .isEquals(); 135 } 136 137 @Override 138 public int hashCode() { 139 return new HashCodeBuilder(17, 37).append(code) 140 .append(message) 141 .append(values) 142 .append(extensionId) 143 .append(extensionKey) 144 .toHashCode(); 145 } 146 147}