public Instance merge()

in iep-servergroups/src/main/java/com/netflix/iep/servergroups/Instance.java [100:115]


  public Instance merge(Instance other) {
    if (!node.equals(other.node)) {
      throw new IllegalArgumentException("merging is only supported for the same instance");
    }
    return builder()
        .node(node)
        .privateIpAddress(orElse(privateIpAddress, other.privateIpAddress))
        .ipv6Address(orElse(ipv6Address, other.ipv6Address))
        .vpcId(orElse(vpcId, other.vpcId))
        .subnetId(orElse(subnetId, other.subnetId))
        .ami(orElse(ami, other.ami))
        .vmtype(orElse(vmtype, other.vmtype))
        .zone(orElse(zone, other.zone))
        .status(status.ordinal() > other.status.ordinal() ? status : other.status)
        .build();
  }