package com.palacesun.engine.common;

import com.palacesun.masking.log.access.AccessContext;
import java.sql.Statement;
import java.util.List;
import java.util.Map;

public class StatementInformation implements Loggable {
   private final ConnectionInformation connectionInformation;
   private Statement statement;
   private String statementQuery;
   private long totalTimeElapsed;
   public AccessContext context;
   public List<Map<String, Object>> sqlParse = null;
   public Boolean needSqlParse;

   public StatementInformation(ConnectionInformation connectionInformation) {
      this.connectionInformation = connectionInformation;
   }

   public Statement getStatement() {
      return this.statement;
   }

   public void setStatement(Statement statement) {
      this.statement = statement;
   }

   public String getStatementQuery() {
      return this.statementQuery;
   }

   public void setStatementQuery(String statementQuery) {
      this.statementQuery = statementQuery;
   }

   public ConnectionInformation getConnectionInformation() {
      return this.connectionInformation;
   }

   public String getSqlWithValues() {
      return this.getSql();
   }

   public String getSqlWithSafeValues() {
      return this.getSql();
   }

   public String getSql() {
      return this.getStatementQuery();
   }

   public long getTotalTimeElapsed() {
      return this.totalTimeElapsed;
   }

   public void incrementTimeElapsed(long timeElapsedNanos) {
      this.totalTimeElapsed += timeElapsedNanos;
   }

   public Boolean isNeedSqlParse() {
      return this.needSqlParse;
   }

   public void setNeedSqlParse(Boolean needSqlParse) {
      this.needSqlParse = needSqlParse;
   }
}
