-
- All Implemented Interfaces:
-
java.io.Serializable
public interface ICacheKey implements Serializable
The cache key for key
Must override equals and hashCode method, and the no params constructor. For example:
{@code * public static class SampleKey implements CacheKey { * public String key; * public String subKey; * public String tag; * * // default no params constructor method required * public SampleKey() { * } * * // override equals method required * @Override * public boolean equals(Object object) { * if (this == object) return true; * if (object == null || getClass() != object.getClass()) return false; * SampleKey sampleKey = (SampleKey) object; * return Objects.equals(key, sampleKey.key) && * Objects.equals(subKey, sampleKey.subKey) && * Objects.equals(tag, sampleKey.tag); * } * * // override hashCode method required * @Override * public int hashCode() { * return Objects.hash(key, subKey, tag); * } * } * }