org.apache.zookeeper.data.Stat.equals()方法的使用及代码示例

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

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

Stat.equals介绍

暂无

代码示例

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof SetDataResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 SetDataResponse peer = (SetDataResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof SetACLResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 SetACLResponse peer = (SetACLResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof ExistsResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 ExistsResponse peer = (ExistsResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof SetDataResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 SetDataResponse peer = (SetDataResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof ExistsResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 ExistsResponse peer = (ExistsResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof SetACLResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 SetACLResponse peer = (SetACLResponse) peer_;
 boolean ret = false;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetACLResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetACLResponse peer = (GetACLResponse) peer_;
 boolean ret = false;
 ret = acl.equals(peer.acl);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof Create2Response)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 Create2Response peer = (Create2Response) peer_;
 boolean ret = false;
 ret = path.equals(peer.path);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetChildren2Response)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetChildren2Response peer = (GetChildren2Response) peer_;
 boolean ret = false;
 ret = children.equals(peer.children);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public byte[] get(String key, Stat stat) {
  Entry entry = cache.get(key);
  if (entry == null) {
    return null;
  }
  if (!stat.equals(entry.stat)) {
    // The node has been modified, invalidate cache.
    cache.remove(key);
    return null;
  } else {
    return entry.data;
  }
}

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetACLResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetACLResponse peer = (GetACLResponse) peer_;
 boolean ret = false;
 ret = acl.equals(peer.acl);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetChildren2Response)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetChildren2Response peer = (GetChildren2Response) peer_;
 boolean ret = false;
 ret = children.equals(peer.children);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetDataResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetDataResponse peer = (GetDataResponse) peer_;
 boolean ret = false;
 ret = org.apache.jute.Utils.bufEquals(data,peer.data);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

public boolean equals(Object peer_) {
 if (!(peer_ instanceof GetDataResponse)) {
  return false;
 }
 if (peer_ == this) {
  return true;
 }
 GetDataResponse peer = (GetDataResponse) peer_;
 boolean ret = false;
 ret = org.apache.jute.Utils.bufEquals(data,peer.data);
 if (!ret) return ret;
 ret = stat.equals(peer.stat);
 if (!ret) return ret;
  return ret;
}
public int hashCode() {

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

private void deleteZKDir(ZooKeeper zk, String nodeName)
    throws IOException, InterruptedException, KeeperException {
 Stat stat = zk.exists(nodeName, false);
 if (stat == null) {
  return;
 }
 List<String> children1 = zk.getChildren(nodeName, false);
 List<String> c2 = zk.getChildren(nodeName, false, stat);
 if (!children1.equals(c2)) {
   Assert.fail("children lists from getChildren()/getChildren2() do not match");
 }
 if (!stat.equals(stat)) {
   Assert.fail("stats from exists()/getChildren2() do not match");
 }
 if (children1.size() == 0) {
  zk.delete(nodeName, -1);
  return;
 }
 for (String n : children1) {
  deleteZKDir(zk, n);
 }
}

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

@Test
public void testCreateWithStat()
  throws IOException, KeeperException, InterruptedException {
 String name = "/foo";
 Stat stat = createWithStatVerifyResult("/foo");
 Stat childStat = createWithStatVerifyResult("/foo/child");
 // Don't expect to get the same stats for different creates.
 Assert.assertFalse(stat.equals(childStat));
}

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

@Test(timeout = 30000)
public void testCreateWithStat()
    throws KeeperException, InterruptedException {
  Stat stat = createWithStatVerifyResult("/foo");
  Stat childStat = createWithStatVerifyResult("/foo/child");
  // Don't expect to get the same stats for different creates.
  Assert.assertFalse(stat.equals(childStat));
}

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

if (!stat_parent.equals(stat)) {
  Assert.fail("stat from exists()/getChildren() do not match");

代码示例来源:origin: co.cask.tephra/tephra-core

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || !(o instanceof NodeChildren)) {
  return false;
 }
 NodeChildren that = (NodeChildren) o;
 return stat.equals(that.getStat()) && children.equals(that.getChildren());
}

代码示例来源:origin: org.apache.twill/twill-zookeeper

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || !(o instanceof NodeData)) {
  return false;
 }
 BasicNodeData that = (BasicNodeData) o;
 return stat.equals(that.getStat()) && Arrays.equals(data, that.getData());
}

相关文章