15 package org.openkilda.messaging.info;
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import com.fasterxml.jackson.annotation.JsonInclude;
20 import com.fasterxml.jackson.annotation.JsonProperty;
21 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
22 import com.google.common.base.Objects;
25 @JsonInclude(JsonInclude.Include.NON_NULL)
28 @JsonProperty(
"created_in_cache")
29 private Long createdInCache;
31 @JsonProperty(
"updated_in_cache")
32 private Long updatedInCache;
38 public CacheTimeTag(@JsonProperty(
"created_in_cache") Long createdInCache,
39 @JsonProperty(
"updated_in_cache") Long updatedInCache) {
40 this.createdInCache = createdInCache;
41 this.updatedInCache = updatedInCache;
45 return createdInCache;
49 this.createdInCache = created_in_cache;
53 this.createdInCache = getUnixTimestamp();
57 return updatedInCache;
61 this.updatedInCache = updated_in_cache;
65 this.updatedInCache = getUnixTimestamp();
69 this.createdInCache = src.createdInCache;
70 this.updatedInCache = src.updatedInCache;
82 return Objects.equal(createdInCache, that.createdInCache) &&
83 Objects.equal(updatedInCache, that.updatedInCache);
88 return Objects.hashCode(createdInCache, updatedInCache);
92 private Long getUnixTimestamp()
94 return System.currentTimeMillis() / 1000L;
void copyTimeTag(CacheTimeTag src)
void setUpdatedInCacheNow()
void setUpdatedInCache(Long updated_in_cache)
void setCreatedInCache(Long created_in_cache)
CacheTimeTag(@JsonProperty("created_in_cache") Long createdInCache, @JsonProperty("updated_in_cache") Long updatedInCache)
void setCreatedInCacheNow()