org.springframework.beans.PropertyValue.equals()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(74)

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

PropertyValue.equals介绍

暂无

代码示例

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

@Override
public PropertyValues changesSince(PropertyValues old) {
  MutablePropertyValues changes = new MutablePropertyValues();
  if (old == this) {
    return changes;
  }
  // for each property value in the new set
  for (PropertyValue newPv : this.propertyValueList) {
    // if there wasn't an old one, add it
    PropertyValue pvOld = old.getPropertyValue(newPv.getName());
    if (pvOld == null || !pvOld.equals(newPv)) {
      changes.addPropertyValue(newPv);
    }
  }
  return changes;
}

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

@Override
public PropertyValues changesSince(PropertyValues old) {
  MutablePropertyValues changes = new MutablePropertyValues();
  if (old == this) {
    return changes;
  }
  // for each property value in the new set
  for (PropertyValue newPv : this.propertyValueList) {
    // if there wasn't an old one, add it
    PropertyValue pvOld = old.getPropertyValue(newPv.getName());
    if (pvOld == null || !pvOld.equals(newPv)) {
      changes.addPropertyValue(newPv);
    }
  }
  return changes;
}

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

@Test
public void testAddOrOverride() {
  MutablePropertyValues pvs = new MutablePropertyValues();
  pvs.addPropertyValue(new PropertyValue("forname", "Tony"));
  pvs.addPropertyValue(new PropertyValue("surname", "Blair"));
  pvs.addPropertyValue(new PropertyValue("age", "50"));
  doTestTony(pvs);
  PropertyValue addedPv = new PropertyValue("rod", "Rod");
  pvs.addPropertyValue(addedPv);
  assertTrue(pvs.getPropertyValue("rod").equals(addedPv));
  PropertyValue changedPv = new PropertyValue("forname", "Greg");
  pvs.addPropertyValue(changedPv);
  assertTrue(pvs.getPropertyValue("forname").equals(changedPv));
}

代码示例来源:origin: camunda/camunda-bpm-platform

public PropertyValues changesSince(PropertyValues old) {
  MutablePropertyValues changes = new MutablePropertyValues();
  if (old == this) {
    return changes;
  }
  // for each property value in the new set
  for (PropertyValue newPv : this.propertyValueList) {
    // if there wasn't an old one, add it
    PropertyValue pvOld = old.getPropertyValue(newPv.getName());
    if (pvOld == null) {
      changes.addPropertyValue(newPv);
    }
    else if (!pvOld.equals(newPv)) {
      // it's changed
      changes.addPropertyValue(newPv);
    }
  }
  return changes;
}

代码示例来源:origin: springframework/spring-beans

public PropertyValues changesSince(PropertyValues old) {
  MutablePropertyValues changes = new MutablePropertyValues();
  if (old == this) {
    return changes;
  }
  // for each property value in the new set
  for (Iterator it = this.propertyValueList.iterator(); it.hasNext();) {
    PropertyValue newPv = (PropertyValue) it.next();
    // if there wasn't an old one, add it
    PropertyValue pvOld = old.getPropertyValue(newPv.getName());
    if (pvOld == null) {
      changes.addPropertyValue(newPv);
    }
    else if (!pvOld.equals(newPv)) {
      // it's changed
      changes.addPropertyValue(newPv);
    }
  }
  return changes;
}

相关文章