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

org.conqat.engine.commons.findings.location.TeamscaleIssueLocation Maven / Gradle / Ivy

The newest version!
package org.conqat.engine.commons.findings.location;

import java.io.Serial;
import java.util.Objects;

import org.conqat.lib.commons.test.IndexValueClass;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 * Describes a finding location in an issue or spec item or similar. For field specific locations,
 * see {@link TeamscaleIssueFieldLocation}
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = TeamscaleIssueLocation.class)
@IndexValueClass(containedInBackup = true)
public class TeamscaleIssueLocation extends ElementLocation implements ITeamscaleIssueFindingLocation {

	@Serial
	private static final long serialVersionUID = 1L;

	/** Id of the issue. */
	@JsonProperty("issueId")
	private final String issueId;

	public TeamscaleIssueLocation(TeamscaleIssueLocation location) {
		super(location.getUniformPath());
		issueId = location.issueId;
	}

	public TeamscaleIssueLocation(String uniformPath, String issueId) {
		super(uniformPath);
		this.issueId = issueId;
	}

	@Override
	protected boolean canEqual(Object other) {
		return other instanceof TeamscaleIssueLocation;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof TeamscaleIssueLocation that)) {
			return false;
		}
		return that.canEqual(this) && Objects.equals(issueId, that.issueId) && super.equals(o);
	}

	@Override
	public int hashCode() {
		return Objects.hash(super.hashCode(), issueId);
	}

	@Override
	public String getIssueId() {
		return issueId;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy