X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdto%2FDomainVo.java;h=91ea87f2d730eda45ce1763e3dd36be299b7f6c2;hb=refs%2Fchanges%2F01%2F98501%2F2;hp=df99ed87d9fc8db5df733729055cad6325c86e33;hpb=510f243992dc434f51178d1797a8045de839c25f;p=portal.git diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java index df99ed87..91ea87f2 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java @@ -45,7 +45,7 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDateTime; import java.util.Set; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; @@ -54,7 +54,9 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.onap.portal.domain.db.fn.FnUser; +import org.onap.portal.utils.EcompPortalUtils; import org.onap.portalsdk.core.domain.FusionVo; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; @Getter @Setter @@ -63,17 +65,22 @@ import org.onap.portalsdk.core.domain.FusionVo; @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable { + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DomainVo.class); private static final long serialVersionUID = 1L; protected Long id; - protected Date created; - protected Date modified; + protected LocalDateTime created; + protected LocalDateTime modified; protected FnUser createdId; protected FnUser modifiedId; protected Long rowNum; protected Serializable auditUserId; protected Set auditTrail = null; + public DomainVo(Long id) { + this.id = id; + } + @Override public int compareTo(Object obj) { Long c1 = this.getId(); @@ -99,7 +106,7 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa newVo.setId(null); } } catch (Exception var8) { - var8.printStackTrace(); + logger.error("exception occured",var8); } return newVo; @@ -108,4 +115,22 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa public Object clone() throws CloneNotSupportedException { return super.clone(); } + + public boolean equals(Object other) { + if (this == other) { + return true; + } else if (other == null) { + return false; + } else if (!(other instanceof DomainVo)) { + return false; + } else { + DomainVo castOther = (DomainVo)other; + return this.getId().equals(castOther.getId()) + && this.getCreated().equals(castOther.getCreated()) + && this.getCreatedId().equals(castOther.getCreatedId()) + && this.getModified().equals(castOther.getModified()) + && this.getModifiedId() == castOther.getModifiedId(); + } + } + }