X-Git-Url: https://gerrit.onap.org/r/gitweb?p=portal.git;a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdto%2Ftransport%2FCentralV2UserApp.java;h=ed07408a768913e47d8c226446f6ce5dbb13f17f;hp=8cc3a5a57cf96b3841d32e37cd5b70a402e7bba5;hb=0dd6f1189815079526c3f5211f01650bbe5e665b;hpb=17eaed467b83748eb842075527a1955da42c6e31 diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/CentralV2UserApp.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/CentralV2UserApp.java index 8cc3a5a5..ed07408a 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/CentralV2UserApp.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/CentralV2UserApp.java @@ -60,14 +60,13 @@ public class CentralV2UserApp implements Serializable, Comparable { private CentralV2Role role; private Integer priority; - public int compareTo(Object other) { - CentralV2UserApp castOther = (CentralV2UserApp) other; - - Long c1 = (this.getUserId() == null ? 0 : this.getUserId()) + (this.priority == null ? 0 : this.priority); - Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId()); - c2 += (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId()); - c2 += (castOther.priority == null ? 0 : castOther.priority); + public int compareTo(Object other){ + CentralV2UserApp castOther = (CentralV2UserApp) other; + Long c1 = (this.getUserId() == null ? 0 : this.getUserId()) + (this.priority == null ? 0 : this.priority); + Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId()); + c2 += (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId()); + c2 += (castOther.priority == null ? 0 : castOther.priority); return c1.compareTo(c2); }