@Test public void testEquals() { Map<Integer, String> map = ImmutableMap.of(1, "name1", 2, "name2", 3, "name3"); EnumTypedef typedef1 = new EnumTypedef("typeName", map); Map<Integer, String> map2 = ImmutableMap.of(2, "name2", 3, "name3", 1, "name1"); EnumTypedef typedef2 = new EnumTypedef("typeName", map2); assertThat(map.equals(map2)).isTrue(); assertThat(typedef1.equals(typedef2)).isTrue(); assertThat(typedef1.hashCode() == typedef2.hashCode()).isTrue(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EnumTypedef that = (EnumTypedef) o; return com.google.common.base.Objects.equal(name, that.name) && com.google.common.base.Objects.equal(map, that.map) && basetype == that.basetype; }
EnumTypedef { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EnumTypedef that = (EnumTypedef) o; return com.google.common.base.Objects.equal(name, that.name) && com.google.common.base.Objects.equal(map, that.map) && basetype == that.basetype; } }
EnumTypedef { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EnumTypedef that = (EnumTypedef) o; return com.google.common.base.Objects.equal(name, that.name) && com.google.common.base.Objects.equal(map, that.map) && basetype == that.basetype; } EnumTypedef(String name, Map<Integer, String> map);  EnumTypedef(String name, Map<Integer, String> map, DataType basetype); }
EnumTypedef { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EnumTypedef that = (EnumTypedef) o; return com.google.common.base.Objects.equal(name, that.name) && com.google.common.base.Objects.equal(map, that.map) && basetype == that.basetype; } EnumTypedef(String name, Map<Integer, String> map);  EnumTypedef(String name, Map<Integer, String> map, DataType basetype); DataType getBaseType(); String getShortName(); ImmutableMap<Integer, String> getMap(); @Nullable Integer lookupEnumInt(String name); @Nullable String lookupEnumString(int e); @Override boolean equals(Object o); boolean equalsMapOnly(Object o); @Override int hashCode(); @Override String toString(); }
EnumTypedef { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EnumTypedef that = (EnumTypedef) o; return com.google.common.base.Objects.equal(name, that.name) && com.google.common.base.Objects.equal(map, that.map) && basetype == that.basetype; } EnumTypedef(String name, Map<Integer, String> map);  EnumTypedef(String name, Map<Integer, String> map, DataType basetype); DataType getBaseType(); String getShortName(); ImmutableMap<Integer, String> getMap(); @Nullable Integer lookupEnumInt(String name); @Nullable String lookupEnumString(int e); @Override boolean equals(Object o); boolean equalsMapOnly(Object o); @Override int hashCode(); @Override String toString();  }