X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2Fstructures%2FLf.java;h=afd40d1c2ba6aee49ed4124380e1cddd14b98585;hb=a84d1bd3fba5d6fb7d9777e1508221e2f773e94f;hp=66cf1cc6101807b8a6f86aae7dacbb4541353dad;hpb=95016a3bb614999a722a5621c7abb0eb7afd63c1;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/structures/Lf.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/structures/Lf.java index 66cf1cc610..afd40d1c2b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/structures/Lf.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/structures/Lf.java @@ -1,19 +1,20 @@ package org.opendaylight.controller.sal.restconf.impl.test.structures; public class Lf extends YangElement { - private String value; + private Object value; + private int numOfEqualItems = 0; - public Lf(String name, String value) { + public Lf(String name, Object value) { super(name); this.value = value; } - public Lf(String value) { + public Lf(Object value) { super(""); this.value = value; } - public String getValue() { + public Object getValue() { return value; } @@ -29,17 +30,29 @@ public class Lf extends YangElement { return false; } Lf lf = (Lf) obj; - if (!this.value.equals(lf.value)) { + if (this.value == null) { + if (lf.value != null) { + return false; + } + } else if (!this.value.equals(lf.value)) { + return false; + } + if (this.numOfEqualItems != lf.numOfEqualItems) { return false; } return true; } + public void incNumOfEqualItems() { + this.numOfEqualItems++; + } + @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((value == null) ? 0 : value.hashCode()); + result = prime * result + numOfEqualItems; return result; }