X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdbcapi.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Futil%2FDmaapTimestamp.java;fp=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Futil%2FDmaapTimestamp.java;h=f36df1c19c2025e2b867a3ef0f5e38a0a554e0f5;hp=776a4b47f992fd7e82a3100e7aaaea3b674b996f;hb=57850893ab80ef3e144e500f9342ed53bfe33823;hpb=0654d98f69b80b8d932dd33a5dcc56dbecc6a64e diff --git a/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java b/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java index 776a4b4..f36df1c 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java +++ b/src/main/java/org/onap/dmaap/dbcapi/util/DmaapTimestamp.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,30 +20,27 @@ package org.onap.dmaap.dbcapi.util; -import java.util.Calendar; -import java.util.Date; - import javax.xml.bind.annotation.XmlRootElement; - -import org.apache.log4j.Logger; +import java.util.Date; @XmlRootElement public class DmaapTimestamp { - static final Logger logger = Logger.getLogger(DmaapTimestamp.class); - private Calendar cal = Calendar.getInstance(); - private Date stamp; - - public DmaapTimestamp() { - - stamp = cal.getTime(); - } - - public void mark() { - stamp = cal.getTime(); - } - - public Date getVal() { - return stamp; - } + private Date stamp; + + public DmaapTimestamp() { + this(new Date()); + } + + DmaapTimestamp(Date stamp) { + this.stamp = new Date(stamp.getTime()); + } + + public void mark() { + stamp = new Date(); + } + + public Date getVal() { + return new Date(stamp.getTime()); + } }