All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.undefinedlabs.scope.rules.sql.model.PreparedStatementQuery Maven / Gradle / Ivy

Go to download

Scope is a APM for tests to give engineering teams unprecedented visibility into their CI process to quickly identify, troubleshoot and fix failed builds. This artifact contains the classes to instrument the Java SQL package.

There is a newer version: 0.15.1-beta.2
Show newest version
package com.undefinedlabs.scope.rules.sql.model;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.HashMap;
import java.util.Map;

public class PreparedStatementQuery {

    public static final PreparedStatementQuery EMPTY = new PreparedStatementQuery("", "", new HashMap());

    private final String sqlMethod;
    private final String sqlStatement;
    private final Map sqlParameterMap;

    public PreparedStatementQuery(final String sqlMethod, final String sqlStatement, final Map sqlParameterMap) {
        this.sqlMethod = sqlMethod;
        this.sqlStatement = sqlStatement;
        this.sqlParameterMap = sqlParameterMap;
    }

    public String getSqlMethod() {
        return sqlMethod;
    }

    public String getSqlStatement() {
        return sqlStatement;
    }

    public Map getSqlParameterMap() {
        return sqlParameterMap;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        PreparedStatementQuery that = (PreparedStatementQuery) o;

        return new EqualsBuilder()
                .append(sqlMethod, that.sqlMethod)
                .append(sqlStatement, that.sqlStatement)
                .append(sqlParameterMap, that.sqlParameterMap)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(sqlMethod)
                .append(sqlStatement)
                .append(sqlParameterMap)
                .toHashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("sqlMethod", sqlMethod)
                .append("sqlStatement", sqlStatement)
                .append("sqlParameterMap", sqlParameterMap)
                .toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy