package org.kne.cloud.network.monitor;
 public class TimestampMonitorKey<K> {
        private final K key;
        private final long sequence;
        
        public TimestampMonitorKey(K key, long sequence) {
            this.key = key;
            this.sequence = sequence;
        }
        
        public K getKey() { return key; }
        public long getSequence() { return sequence; }
        
        @Override
        public int hashCode() {
            return 31 * key.hashCode() + (int) (sequence ^ (sequence >>> 32));
        }
        
        @Override
        public boolean equals(Object obj) {
            if (this == obj) return true;
            if (!(obj instanceof TimestampMonitorKey)) return false;
            TimestampMonitorKey<?> other = (TimestampMonitorKey<?>) obj;
            return key.equals(other.key) && sequence == other.sequence;
        }

		@Override
		public String toString() {
			return "TimestampMonitorKey [key=" + key + ", sequence=" + sequence + "]";
		}
    }