gpt4 book ai didi

java - Robospice 缓存对象始终为空

转载 作者:行者123 更新时间:2023-11-30 09:13:48 26 4
gpt4 key购买 nike

出于某种原因,从 Robospice 的缓存中拉回缓存对象始终为空。我做错了什么吗?

getSpiceManager().execute(cardRequest, Card.class.getName(),  
DurationInMillis.ONE_DAY, new CardRequestListener());

是如何执行的。 spice 管理器创建如下:

mSpiceManager = new SpiceManager(JacksonGoogleHttpClientSpiceService.class);

卡片类如下:

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"iosThumbHighRes",
"iosThumb",
"iosLargeHiRes",
"iosLargeHighRes",
"iosLarge"
})
public class Card {

@JsonProperty("iosThumbHighRes")
private String iosThumbHighRes;
@JsonProperty("iosThumb")
private String iosThumb;
@JsonProperty("iosLargeHiRes")
private String iosLargeHiRes;
@JsonProperty("iosLargeHighRes")
private String iosLargeHighRes;
@JsonProperty("iosLarge")
private String iosLarge;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@JsonProperty("iosThumbHighRes")
public String getIosThumbHighRes() {
return iosThumbHighRes;
}

@JsonProperty("iosThumbHighRes")
public void setIosThumbHighRes(String iosThumbHighRes) {
this.iosThumbHighRes = iosThumbHighRes;
}

@JsonProperty("iosThumb")
public String getIosThumb() {
return iosThumb;
}

@JsonProperty("iosThumb")
public void setIosThumb(String iosThumb) {
this.iosThumb = iosThumb;
}

@JsonProperty("iosLargeHiRes")
public String getIosLargeHiRes() {
return iosLargeHiRes;
}

@JsonProperty("iosLargeHiRes")
public void setIosLargeHiRes(String iosLargeHiRes) {
this.iosLargeHiRes = iosLargeHiRes;
}

@JsonProperty("iosLargeHighRes")
public String getIosLargeHighRes() {
return iosLargeHighRes;
}

@JsonProperty("iosLargeHighRes")
public void setIosLargeHighRes(String iosLargeHighRes) {
this.iosLargeHighRes = iosLargeHighRes;
}

@JsonProperty("iosLarge")
public String getIosLarge() {
return iosLarge;
}

@JsonProperty("iosLarge")
public void setIosLarge(String iosLarge) {
this.iosLarge = iosLarge;
}

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}

@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}

@Override
public boolean equals(Object other) {
return EqualsBuilder.reflectionEquals(this, other);
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperties(String name, Object value) {
this.additionalProperties.put(name, value);
}

}

我还需要设置什么吗?

谢谢,格雷姆

最佳答案

Google Http 客户端使用@Key 注释。您正在使用 Googe Http Java 客户端不支持的 Jackson 注释,因为它提供了一个覆盖所有序列化解决方案 (gson/jackson) 的抽象层。

关于java - Robospice 缓存对象始终为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20847599/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com