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

com.sap.cloud.sdk.service.csn2jpa.issuecollector.Issue Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
/*******************************************************************************
 * * © 2018 SAP SE or an SAP affiliate company. All rights reserved. *
 ******************************************************************************/
package com.sap.cloud.sdk.service.csn2jpa.issuecollector;

public class Issue {

	private final String location;
	private final String message;
	private final IssueType type;
	private final String reporter;

	public static Issue create(IssueType type, String location, String message, String reporter) {
		return new Issue(type, location, message, reporter);
	}

	private Issue(IssueType type, String location, String message, String reporter) {
		this.location = location;
		this.type = type;
		this.message = message;
		this.reporter = reporter;
	}

	public String getMessage() {
		return message;
	}

	public IssueType getType() {
		return type;
	}

	public String getLocation() {
		return location;
	}

	public String getReporter() {
		return reporter;
	}

	@Override
	public String toString() {
		return location + ": " + message;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((location == null) ? 0 : location.hashCode());
		result = prime * result + ((message == null) ? 0 : message.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		result = prime * result + ((reporter == null) ? 0 : reporter.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Issue other = (Issue) obj;
		if (location == null) {
			if (other.location != null)
				return false;
		} else if (!location.equals(other.location))
			return false;
		if (message == null) {
			if (other.message != null)
				return false;
		} else if (!message.equals(other.message)) {
			return false;
		} else if (!reporter.equals(other.reporter))
			return false;
		if (type != other.type)
			return false;
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy