Simplifies and clarifies the code.
Change-Id: I1dba9eeeb9ce69be6de9f0fd4088ac6afa7d0e25
Signed-off-by: Robert Varga <rovarga@cisco.com>
return false;
}
final SchemaPath other = (SchemaPath) obj;
-
- if (qname != null) {
- if (!qname.equals(other.qname)) {
- return false;
- }
- } else {
- if (other.qname != null) {
- return false;
- }
- }
-
- if (parent == null) {
- return other.parent == null;
- }
- return parent.equals(other.parent);
+ return Objects.equals(qname, other.qname) && Objects.equals(parent, other.parent);
}
@Override
return false;
}
final SchemaNodeIdentifier other = (SchemaNodeIdentifier) obj;
-
- if (qname != null) {
- if (!qname.equals(other.qname)) {
- return false;
- }
- } else {
- if (other.qname != null) {
- return false;
- }
- }
-
- if (parent == null) {
- return other.parent == null;
- }
- return parent.equals(other.parent);
+ return Objects.equals(qname, other.qname) && Objects.equals(parent, other.parent);
}
@Override
return false;
}
SourceIdentifier other = (SourceIdentifier) obj;
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
- return false;
- }
- if (revision == null) {
- if (other.revision != null) {
- return false;
- }
- } else if (!revision.equals(other.revision)) {
- return false;
- }
- return true;
+ return Objects.equals(name, other.name) && Objects.equals(revision, other.revision);
}
public static SourceIdentifier create(final String moduleName, final Optional<String> revision) {