001package org.slf4j.event; 002 003import java.util.Objects; 004 005public class KeyValuePair { 006 007 public final String key; 008 public final Object value; 009 010 public KeyValuePair(String key, Object value) { 011 this.key = key; 012 this.value = value; 013 } 014 015 @Override 016 public String toString() { 017 return String.valueOf(key) + "=\"" + String.valueOf(value) +"\""; 018 } 019 020 @Override 021 public boolean equals(Object o) { 022 if(this == o) return true; 023 if(o == null || getClass() != o.getClass()) return false; 024 KeyValuePair that = (KeyValuePair) o; 025 return Objects.equals(key, that.key) && Objects.equals(value, that.value); 026 } 027 028 @Override 029 public int hashCode() { 030 return Objects.hash(key, value); 031 } 032}