java.util.HashMap.equals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中java.util.HashMap.equals()方法的一些代码示例,展示了HashMap.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashMap.equals()方法的具体详情如下:
包路径:java.util.HashMap
类名称:HashMap
方法名:equals

HashMap.equals介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof FlashMap)) {
    return false;
  }
  FlashMap otherFlashMap = (FlashMap) other;
  return (super.equals(otherFlashMap) &&
      ObjectUtils.nullSafeEquals(this.targetRequestPath, otherFlashMap.targetRequestPath) &&
      this.targetRequestParams.equals(otherFlashMap.targetRequestParams));
}

代码示例来源:origin: jfinal/jfinal

public boolean equals(Object kv) {
    return kv instanceof Kv && super.equals(kv);
  }
}

代码示例来源:origin: jfinal/jfinal

public boolean equals(Object jMap) {
    return jMap instanceof JMap && super.equals(jMap);
  }
}

代码示例来源:origin: jfinal/jfinal

public boolean equals(Object ret) {
    return ret instanceof Ret && super.equals(ret);
  }
}

代码示例来源:origin: org.apache.poi/poi

@Override
public boolean equals(Object obj) {
  return obj instanceof CustomProperties && props.equals(((CustomProperties) obj).props);
}

代码示例来源:origin: Alluxio/alluxio

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (!(o instanceof MountPointInfo)) {
  return false;
 }
 MountPointInfo that = (MountPointInfo) o;
 return mUfsUri.equals(that.mUfsUri) && mUfsType.equals(that.mUfsType)
   && mUfsCapacityBytes == that.mUfsCapacityBytes && mUfsUsedBytes == that.mUfsUsedBytes
   && mReadOnly == that.mReadOnly && mProperties.equals(that.mProperties)
   && mShared == that.mShared;
}

代码示例来源:origin: org.springframework/spring-webmvc

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof FlashMap)) {
    return false;
  }
  FlashMap otherFlashMap = (FlashMap) other;
  return (super.equals(otherFlashMap) &&
      ObjectUtils.nullSafeEquals(this.targetRequestPath, otherFlashMap.targetRequestPath) &&
      this.targetRequestParams.equals(otherFlashMap.targetRequestParams));
}

代码示例来源:origin: apache/rocketmq

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  BrokerData other = (BrokerData) obj;
  if (brokerAddrs == null) {
    if (other.brokerAddrs != null)
      return false;
  } else if (!brokerAddrs.equals(other.brokerAddrs))
    return false;
  if (brokerName == null) {
    if (other.brokerName != null)
      return false;
  } else if (!brokerName.equals(other.brokerName))
    return false;
  return true;
}

代码示例来源:origin: spotbugs/spotbugs

public static void main(String args[]) {
  HashMap m = new HashMap();
  System.out.println(m.equals(null));
  LinkedHashMap lhm = (LinkedHashMap) m;
  ArrayList<String> a = new ArrayList<String>();
  String s[] = (String[]) a.toArray();
  Object x = m;
  HashSet set = (HashSet) x;
}

代码示例来源:origin: apache/rocketmq

if (other.filterServerTable != null)
    return false;
} else if (!filterServerTable.equals(other.filterServerTable))
  return false;
return true;

代码示例来源:origin: apache/hive

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ArrayWritableObjectInspector that = (ArrayWritableObjectInspector) o;
 if (isRoot != that.isRoot ||
  (typeInfo != null ? !typeInfo.equals(that.typeInfo) : that.typeInfo != null) ||
  (fieldInfos != null ? !fieldInfos.equals(that.fieldInfos) : that.fieldInfos != null) ||
  (fieldNames != null ? !fieldNames.equals(that.fieldNames) : that.fieldNames != null) ||
  (fields != null ? !fields.equals(that.fields) : that.fields != null)) {
  return false;
 }
 return fieldsByName != null ? fieldsByName.equals(that.fieldsByName) : that.fieldsByName == null;
}

代码示例来源:origin: voldemort/voldemort

@Override
public synchronized boolean equals(Object o) {
  if (this == o)
    return true;
  if (o == null || getClass() != o.getClass())
    return false;
  RebalanceTaskInfo that = (RebalanceTaskInfo)o;
  if (donorId != that.donorId)
    return false;
  if (stealerId != that.stealerId)
    return false;
  if (!initialCluster.equals(that.initialCluster))
    return false;
  if (storeToPartitionIds != null ? !storeToPartitionIds.equals(that.storeToPartitionIds) 
                  : that.storeToPartitionIds != null)
    return false;
  return true;
}

代码示例来源:origin: apache/drill

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ArrayWritableObjectInspector that = (ArrayWritableObjectInspector) o;
 if (isRoot != that.isRoot ||
  (typeInfo != null ? !typeInfo.equals(that.typeInfo) : that.typeInfo != null) ||
  (fieldInfos != null ? !fieldInfos.equals(that.fieldInfos) : that.fieldInfos != null) ||
  (fieldNames != null ? !fieldNames.equals(that.fieldNames) : that.fieldNames != null) ||
  (fields != null ? !fields.equals(that.fields) : that.fields != null)) {
  return false;
 }
 return fieldsByName != null ? fieldsByName.equals(that.fieldsByName) : that.fieldsByName == null;
}

代码示例来源:origin: alibaba/mdrill

@Override
public boolean equals(Object assignment) {
  if (assignment instanceof CommonStatsData
      && ((CommonStatsData) assignment).get_emitted().equals(emitted)
      && ((CommonStatsData) assignment).transferred
          .equals(transferred)
      && ((CommonStatsData) assignment).getRate()==rate
  ) {
    return true;
  }
  return false;
}

代码示例来源:origin: alibaba/mdrill

@Override
public boolean equals(Object assignment) {
  if (assignment instanceof BoltTaskStatsData
      && ((BoltTaskStatsData) assignment).getCommon().equals(common)
      && ((BoltTaskStatsData) assignment).getAcked().equals(acked)
      && ((BoltTaskStatsData) assignment).getFailed().equals(failed)
      && ((BoltTaskStatsData) assignment).getProcess_latencies()
          .equals(process_latencies)
  ) {
    return true;
  }
  return false;
}

代码示例来源:origin: apache/geode

public boolean equals(Object o) {
 if (!(o instanceof SubClass)) {
  return false;
 }
 SubClass other = (SubClass) o;
 if (this.intValue != other.intValue) {
  return false;
 } else if (!this.map.equals(other.map)) {
  return false;
 } else if (this.longValue != other.longValue) {
  return false;
 } else if (!this.anotherMap.equals(other.anotherMap)) {
  return false;
 } else {
  return true;
 }
}

代码示例来源:origin: wildfly/wildfly

if (other.connectionProperties != null)
    return false;
} else if (!connectionProperties.equals(other.connectionProperties))
  return false;
if (connectionUrl == null) {

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public boolean equals(Object other) {
    if (this == other)
      return true;
    if (other == null || getClass() != other.getClass())
      return false;
    TestObject obj = (TestObject)other;
    assert this == selfRef;
    assert obj == obj.selfRef;
    return boolVal == obj.boolVal && intVal == obj.intVal && longVal == obj.longVal &&
      Arrays.equals(dblArr, obj.dblArr) && Arrays.equals(longArr, obj.longArr) &&
      list.equals(obj.list) && map.equals(obj.map);
  }
}

代码示例来源:origin: alibaba/mdrill

@Override
public boolean equals(Object assignment) {
  if (assignment instanceof SpoutTaskStatsData
      && ((SpoutTaskStatsData) assignment).getCommon().equals(common)
      && ((SpoutTaskStatsData) assignment).get_acked().equals(acked)
      && ((SpoutTaskStatsData) assignment).get_fail().equals(failed)
      && ((SpoutTaskStatsData) assignment).getComplete_latencies().equals(complete_latencies)
  ) {
    return true;
  }
  return false;
}

代码示例来源:origin: apache/flink

@Override
public boolean equals(Object obj) {
  return super.equals(obj)
      && (obj instanceof PojoSerializerConfigSnapshot)
      && fieldToSerializerConfigSnapshot.equals(((PojoSerializerConfigSnapshot) obj).getFieldToSerializerConfigSnapshot())
      && registeredSubclassesToSerializerConfigSnapshots.equals(((PojoSerializerConfigSnapshot) obj).getRegisteredSubclassesToSerializerConfigSnapshots())
      && nonRegisteredSubclassesToSerializerConfigSnapshots.equals(((PojoSerializerConfigSnapshot) obj).nonRegisteredSubclassesToSerializerConfigSnapshots);
}

相关文章