package com.alibaba.druid.util;

import java.util.ArrayList;
import java.util.List;

public class TransactionInfo {
   private final long id;
   private final List<String> sqlList = new ArrayList(4);
   private final long startTimeMillis;
   private long endTimeMillis;

   public TransactionInfo(long id) {
      this.id = id;
      this.startTimeMillis = System.currentTimeMillis();
   }

   public long getId() {
      return this.id;
   }

   public List<String> getSqlList() {
      return this.sqlList;
   }

   public long getStartTimeMillis() {
      return this.startTimeMillis;
   }

   public long getEndTimeMillis() {
      return this.endTimeMillis;
   }

   public void setEndTimeMillis() {
      if (this.endTimeMillis == 0L) {
         this.endTimeMillis = System.currentTimeMillis();
      }

   }

   public void setEndTimeMillis(long endTimeMillis) {
      this.endTimeMillis = endTimeMillis;
   }
}
