/* * Copyright 2015 Edward Capriolo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.teknek.nibiru; import org.codehaus.jackson.annotate.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public class Val { private String value; private long time; private long createTime; private long ttl; //serialization @SuppressWarnings("unused") private Val(){} public Val(String value, long time, long createTime, long ttl){ this.value = value; this.time = time; this.createTime = createTime; this.ttl = ttl; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public long getTime() { return time; } public void setTime(long time) { this.time = time; } public long getCreateTime() { return createTime; } public void setCreateTime(long createTime) { this.createTime = createTime; } public long getTtl() { return ttl; } public void setTtl(long ttl) { this.ttl = ttl; } @Override public String toString() { return "Val [value=" + value + ", time=" + time + ", createTime=" + createTime + ", ttl=" + ttl + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (time ^ (time >>> 32)); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Val other = (Val) obj; if (time != other.time) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; } }