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

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

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

Properties.equals介绍

暂无

代码示例

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

public static boolean isPropertiesEqual(final Properties p1, final Properties p2) {
  return p1.equals(p2);
}

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

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof ArtifactMd5Checksums)) {
    return false;
  }
  ArtifactMd5Checksums that = (ArtifactMd5Checksums) o;
  if (checksumProperties != null ? !checksumProperties.equals(that.checksumProperties) : that.checksumProperties != null) {
    return false;
  }
  return true;
}

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

@Override
public synchronized boolean equals(Object o) {
 if (interned != null) return interned.equals(o);
 else return super.equals(o);
}

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

public boolean equals(Object o) {
 return delegate.equals(o);
}

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

@Override
public final synchronized boolean equals(Object o) {
  return super.equals(o);
}

代码示例来源:origin: ctripcorp/apollo

private synchronized void updateFileProperties(Properties newProperties, ConfigSourceType sourceType) {
 this.m_sourceType = sourceType;
 if (newProperties.equals(m_fileProperties)) {
  return;
 }
 this.m_fileProperties = newProperties;
 persistLocalCacheFile(m_baseDir, m_namespace);
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public synchronized boolean equals( Object o ) {
 super.putAll( storageMap );
 boolean result = super.equals( o );
 super.clear();
 return result;
}

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

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 LuceneTestSerializer that = (LuceneTestSerializer) o;
 return props.equals(that.props);
}

代码示例来源:origin: apache/incubator-gobblin

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 if (!super.equals(o)) {
  return false;
 }
 ImmutableProperties that = (ImmutableProperties) o;
 return props != null ? props.equals(that.props) : that.props == null;
}

代码示例来源:origin: knightliao/disconf

public boolean equals(Object o) {
  return getDelegate().equals(o);
}

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

@Override
public boolean equals(Object obj) {
 if (this == obj)
  return true;
 if (!(obj instanceof TestFunction)) {
  return false;
 }
 TestFunction function = (TestFunction) obj;
 return this.props.equals(function.getConfig());
}

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

public boolean equals(Object obj) {
 if (this == obj) {
  return true;
 }
 if (!(obj instanceof DBLoader)) {
  return false;
 }
 DBLoader other = (DBLoader) obj;
 if (!this.props.equals(other.props)) {
  return false;
 }
 return true;
}

代码示例来源:origin: ctripcorp/apollo

@Override
public void onRepositoryChange(String namespace, Properties newProperties) {
 if (newProperties.equals(m_fileProperties)) {
  return;
 }
 Properties newFileProperties = new Properties();
 newFileProperties.putAll(newProperties);
 updateFileProperties(newFileProperties, m_upstream.getSourceType());
 this.fireRepositoryChange(namespace, newProperties);
}

代码示例来源:origin: ctripcorp/apollo

@Override
public synchronized void onRepositoryChange(String namespace, Properties newProperties) {
 if (newProperties.equals(m_configProperties.get())) {
  return;
 }
 ConfigSourceType sourceType = m_configRepository.getSourceType();
 Properties newConfigProperties = new Properties();
 newConfigProperties.putAll(newProperties);
 Map<String, ConfigChange> actualChanges = updateAndCalcConfigChanges(newConfigProperties, sourceType);
 //check double checked result
 if (actualChanges.isEmpty()) {
  return;
 }
 this.fireConfigChange(new ConfigChangeEvent(m_namespace, actualChanges));
 Tracer.logEvent("Apollo.Client.ConfigChanges", m_namespace);
}

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

/**
 * Compares two avro strings which contains single store configs
 * 
 * @param configAvro1
 * @param configAvro2
 * @return true if two config avro strings have same content
 */
public static Boolean compareSingleClientConfigAvro(String configAvro1, String configAvro2) {
  Properties props1 = readSingleClientConfigAvro(configAvro1);
  Properties props2 = readSingleClientConfigAvro(configAvro2);
  if(props1.equals(props2)) {
    return true;
  } else {
    return false;
  }
}

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

@Override
public boolean equals(Object o) {
 if (o == null) {
  return false;
 }
 if (!(o instanceof ClassName)) {
  return false;
 }
 ClassName that = (ClassName) o;
 return this.className.equals(that.getClassName())
   && this.getInitProperties().equals(that.getInitProperties());
}

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

/**
 * Checks the local member metadata for changes.
 */
private void checkMetadata() {
 if (!localMember.properties().equals(localProperties)) {
  localProperties = new Properties();
  localProperties.putAll(localMember.properties());
  post(new GroupMembershipEvent(GroupMembershipEvent.Type.METADATA_CHANGED, localMember));
 }
}

代码示例来源:origin: ctripcorp/apollo

@Override
public synchronized void onRepositoryChange(String namespace, Properties newProperties) {
 if (newProperties.equals(m_configProperties)) {
  return;
 }
 Properties newConfigProperties = new Properties();
 newConfigProperties.putAll(newProperties);
 List<ConfigChange> changes = calcPropertyChanges(namespace, m_configProperties, newConfigProperties);
 Map<String, ConfigChange> changeMap = Maps.uniqueIndex(changes,
   new Function<ConfigChange, String>() {
    @Override
    public String apply(ConfigChange input) {
     return input.getPropertyName();
    }
   });
 updateConfig(newConfigProperties, m_configRepository.getSourceType());
 clearConfigCache();
 this.fireConfigChange(new ConfigChangeEvent(m_namespace, changeMap));
 Tracer.logEvent("Apollo.Client.ConfigChanges", m_namespace);
}

代码示例来源:origin: ctripcorp/apollo

@Override
public synchronized void onRepositoryChange(String namespace, Properties newProperties) {
 if (newProperties.equals(m_configProperties.get())) {
  return;
 }
 Properties newConfigProperties = new Properties();
 newConfigProperties.putAll(newProperties);
 String oldValue = getContent();
 update(newProperties);
 m_sourceType = m_configRepository.getSourceType();
 String newValue = getContent();
 PropertyChangeType changeType = PropertyChangeType.MODIFIED;
 if (oldValue == null) {
  changeType = PropertyChangeType.ADDED;
 } else if (newValue == null) {
  changeType = PropertyChangeType.DELETED;
 }
 this.fireConfigChange(new ConfigFileChangeEvent(m_namespace, oldValue, newValue, changeType));
 Tracer.logEvent("Apollo.Client.ConfigChanges", m_namespace);
}

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

/**
 * Checks the local member metadata for changes.
 */
private void checkMetadata() {
 if (!localMember.properties().equals(localProperties)) {
  localProperties = new Properties();
  localProperties.putAll(localMember.properties());
  LOGGER.debug("{} - Detected local properties change {}", localMember.id(), localProperties);
  localMember.setIncarnationNumber(localMember.getIncarnationNumber() + 1);
  post(new GroupMembershipEvent(GroupMembershipEvent.Type.METADATA_CHANGED, localMember));
  recordUpdate(localMember.copy());
 }
}

相关文章

微信公众号

最新文章

更多