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

joynr.system.JoynrLoggedError Maven / Gradle / Ivy

There is a newer version: 1.25.0
Show newest version
		/*
		 *
		 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
		 *
		 * Licensed under the Apache License, Version 2.0 (the "License");
		 * you may not use this file except in compliance with the License.
		 * You may obtain a copy of the License at
		 *
		 *      http://www.apache.org/licenses/LICENSE-2.0
		 *
		 * Unless required by applicable law or agreed to in writing, software
		 * distributed under the License is distributed on an "AS IS" BASIS,
		 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
		 * See the License for the specific language governing permissions and
		 * limitations under the License.
		 */
		
		// #####################################################
		//#######################################################
		//###                                                 ###
		//##    WARNING: This file is generated. DO NOT EDIT   ##
		//##             All changes will be lost!             ##
		//###                                                 ###
		//#######################################################
		// #####################################################

package joynr.system;
import java.io.Serializable;

import io.joynr.subtypes.JoynrType;

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

// NOTE: serialVersionUID is not defined since we don't support Franca versions right now.
//       The compiler will generate a serialVersionUID based on the class and its members
//       (cf. http://docs.oracle.com/javase/6/docs/platform/serialization/spec/class.html#4100),
//       which is probably more restrictive than what we want.

/**
 * The classification of the exception
 */
@SuppressWarnings("serial")
public class JoynrLoggedError implements Serializable, JoynrType {
	public static final int MAJOR_VERSION = 0;
	public static final int MINOR_VERSION = 0;
	@JsonProperty("exceptionClass")
	private String exceptionClass;
	@JsonProperty("exceptionMessage")
	private String exceptionMessage;

	/**
	 * Default Constructor
	 */
	public JoynrLoggedError() {
		this.exceptionClass = "";
		this.exceptionMessage = "";
	}

	/**
	 * Copy constructor
	 *
	 * @param joynrLoggedErrorObj reference to the object to be copied
	 */
	public JoynrLoggedError(JoynrLoggedError joynrLoggedErrorObj) {
		this.exceptionClass = joynrLoggedErrorObj.exceptionClass;
		this.exceptionMessage = joynrLoggedErrorObj.exceptionMessage;
	}

	/**
	 * Parameterized constructor
	 *
	 * @param exceptionClass The classification of the exception
	 * @param exceptionMessage The message describing the exception
	 */
	public JoynrLoggedError(
		String exceptionClass,
		String exceptionMessage
		) {
		this.exceptionClass = exceptionClass;
		this.exceptionMessage = exceptionMessage;
	}

	/**
	 * Gets ExceptionClass
	 *
	 * @return The classification of the exception
	 */
	@JsonIgnore
	public String getExceptionClass() {
		return this.exceptionClass;
	}

	/**
	 * Sets ExceptionClass
	 *
	 * @param exceptionClass The classification of the exception
	 */
	@JsonIgnore
	public void setExceptionClass(String exceptionClass) {
		this.exceptionClass = exceptionClass;
	}

	/**
	 * Gets ExceptionMessage
	 *
	 * @return The message describing the exception
	 */
	@JsonIgnore
	public String getExceptionMessage() {
		return this.exceptionMessage;
	}

	/**
	 * Sets ExceptionMessage
	 *
	 * @param exceptionMessage The message describing the exception
	 */
	@JsonIgnore
	public void setExceptionMessage(String exceptionMessage) {
		this.exceptionMessage = exceptionMessage;
	}


	/**
	 * Stringifies the class
	 *
	 * @return stringified class content
	 */
	@Override
	public String toString() {
		return "JoynrLoggedError ["
		+ "exceptionClass=" + this.exceptionClass + ", "
		+ "exceptionMessage=" + this.exceptionMessage
		+ "]";
	}

	/**
	 * Check for equality
	 *
	 * @param obj Reference to the object to compare to
	 * @return true, if objects are equal, false otherwise
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		JoynrLoggedError other = (JoynrLoggedError) obj;
		if (this.exceptionClass == null) {
			if (other.exceptionClass != null) {
				return false;
			}
		} else if (!this.exceptionClass.equals(other.exceptionClass)){
			return false;
		}
		if (this.exceptionMessage == null) {
			if (other.exceptionMessage != null) {
				return false;
			}
		} else if (!this.exceptionMessage.equals(other.exceptionMessage)){
			return false;
		}
		return true;
	}

	/**
	 * Calculate code for hashing based on member contents
	 *
	 * @return The calculated hash code
	 */
	@Override
	public int hashCode() {
		int result = 1;
		final int prime = 31;
		result = prime * result + ((this.exceptionClass == null) ? 0 : this.exceptionClass.hashCode());
		result = prime * result + ((this.exceptionMessage == null) ? 0 : this.exceptionMessage.hashCode());
		return result;
	}
}

	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy