joynr.system.JoynrLogEvent Maven / Gradle / Ivy
/*
*
* Copyright (C) 2011 - 2016 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 joynr.system.JoynrLogLevel;
import joynr.system.JoynrLoggedError;
import joynr.system.JoynrLoggingContextTag;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
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.
/**
* Record describing a log event
*/
@SuppressWarnings("serial")
public class JoynrLogEvent implements Serializable, JoynrType {
public static final int MAJOR_VERSION = 0;
public static final int MINOR_VERSION = 0;
@JsonProperty("timestamp")
private Long timestamp;
@JsonProperty("eventVersion")
private String eventVersion;
@JsonProperty("host")
private String host;
@JsonProperty("path")
private String path;
@JsonProperty("message")
private String message;
@JsonProperty("priority")
private JoynrLogLevel priority;
@JsonProperty("errorEvent")
private JoynrLoggedError errorEvent;
@JsonProperty("tags")
private JoynrLoggingContextTag[] tags = {};
/**
* Default Constructor
*/
public JoynrLogEvent() {
this.timestamp = 0L;
this.eventVersion = "";
this.host = "";
this.path = "";
this.message = "";
this.priority = JoynrLogLevel.OFF;
this.errorEvent = new JoynrLoggedError();
}
/**
* Copy constructor
*
* @param joynrLogEventObj reference to the object to be copied
*/
public JoynrLogEvent(JoynrLogEvent joynrLogEventObj) {
this.timestamp = joynrLogEventObj.timestamp;
this.eventVersion = joynrLogEventObj.eventVersion;
this.host = joynrLogEventObj.host;
this.path = joynrLogEventObj.path;
this.message = joynrLogEventObj.message;
this.priority = joynrLogEventObj.priority;
this.errorEvent = new JoynrLoggedError(joynrLogEventObj.errorEvent);
this.tags = joynrLogEventObj.tags;
}
/**
* Parameterized constructor
*
* @param timestamp The time the logging event happened
* @param eventVersion The version of the event
* @param host The host
* @param path The path
* @param message The message
* @param priority The priority
* @param errorEvent The event
* @param tags List of text classifying the event
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "joynr object not used for storing internal state")
public JoynrLogEvent(
Long timestamp,
String eventVersion,
String host,
String path,
String message,
JoynrLogLevel priority,
JoynrLoggedError errorEvent,
JoynrLoggingContextTag[] tags
) {
this.timestamp = timestamp;
this.eventVersion = eventVersion;
this.host = host;
this.path = path;
this.message = message;
this.priority = priority;
this.errorEvent = errorEvent;
this.tags = tags;
}
/**
* Gets Timestamp
*
* @return The time the logging event happened
*/
@JsonIgnore
public Long getTimestamp() {
return this.timestamp;
}
/**
* Sets Timestamp
*
* @param timestamp The time the logging event happened
*/
@JsonIgnore
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
/**
* Gets EventVersion
*
* @return The version of the event
*/
@JsonIgnore
public String getEventVersion() {
return this.eventVersion;
}
/**
* Sets EventVersion
*
* @param eventVersion The version of the event
*/
@JsonIgnore
public void setEventVersion(String eventVersion) {
this.eventVersion = eventVersion;
}
/**
* Gets Host
*
* @return The host
*/
@JsonIgnore
public String getHost() {
return this.host;
}
/**
* Sets Host
*
* @param host The host
*/
@JsonIgnore
public void setHost(String host) {
this.host = host;
}
/**
* Gets Path
*
* @return The path
*/
@JsonIgnore
public String getPath() {
return this.path;
}
/**
* Sets Path
*
* @param path The path
*/
@JsonIgnore
public void setPath(String path) {
this.path = path;
}
/**
* Gets Message
*
* @return The message
*/
@JsonIgnore
public String getMessage() {
return this.message;
}
/**
* Sets Message
*
* @param message The message
*/
@JsonIgnore
public void setMessage(String message) {
this.message = message;
}
/**
* Gets Priority
*
* @return The priority
*/
@JsonIgnore
public JoynrLogLevel getPriority() {
return this.priority;
}
/**
* Sets Priority
*
* @param priority The priority
*/
@JsonIgnore
public void setPriority(JoynrLogLevel priority) {
this.priority = priority;
}
/**
* Gets ErrorEvent
*
* @return The event
*/
@JsonIgnore
public JoynrLoggedError getErrorEvent() {
return this.errorEvent;
}
/**
* Sets ErrorEvent
*
* @param errorEvent The event
*/
@JsonIgnore
public void setErrorEvent(JoynrLoggedError errorEvent) {
this.errorEvent = errorEvent;
}
/**
* Gets Tags
*
* @return List of text classifying the event
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "joynr object not used for storing internal state")
@JsonIgnore
public JoynrLoggingContextTag[] getTags() {
return this.tags;
}
/**
* Sets Tags
*
* @param tags List of text classifying the event
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "joynr object not used for storing internal state")
@JsonIgnore
public void setTags(JoynrLoggingContextTag[] tags) {
this.tags = tags;
}
/**
* Stringifies the class
*
* @return stringified class content
*/
@Override
public String toString() {
return "JoynrLogEvent ["
+ "timestamp=" + this.timestamp + ", "
+ "eventVersion=" + this.eventVersion + ", "
+ "host=" + this.host + ", "
+ "path=" + this.path + ", "
+ "message=" + this.message + ", "
+ "priority=" + this.priority + ", "
+ "errorEvent=" + this.errorEvent + ", "
+ "tags=" + java.util.Arrays.toString(this.tags)
+ "]";
}
/**
* 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;
JoynrLogEvent other = (JoynrLogEvent) obj;
if (this.timestamp == null) {
if (other.timestamp != null) {
return false;
}
} else if (!this.timestamp.equals(other.timestamp)){
return false;
}
if (this.eventVersion == null) {
if (other.eventVersion != null) {
return false;
}
} else if (!this.eventVersion.equals(other.eventVersion)){
return false;
}
if (this.host == null) {
if (other.host != null) {
return false;
}
} else if (!this.host.equals(other.host)){
return false;
}
if (this.path == null) {
if (other.path != null) {
return false;
}
} else if (!this.path.equals(other.path)){
return false;
}
if (this.message == null) {
if (other.message != null) {
return false;
}
} else if (!this.message.equals(other.message)){
return false;
}
if (this.priority == null) {
if (other.priority != null) {
return false;
}
} else if (!this.priority.equals(other.priority)){
return false;
}
if (this.errorEvent == null) {
if (other.errorEvent != null) {
return false;
}
} else if (!this.errorEvent.equals(other.errorEvent)){
return false;
}
if (this.tags == null) {
if (other.tags != null) {
return false;
}
} else if (!java.util.Arrays.deepEquals(this.tags, other.tags)){
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.timestamp == null) ? 0 : this.timestamp.hashCode());
result = prime * result + ((this.eventVersion == null) ? 0 : this.eventVersion.hashCode());
result = prime * result + ((this.host == null) ? 0 : this.host.hashCode());
result = prime * result + ((this.path == null) ? 0 : this.path.hashCode());
result = prime * result + ((this.message == null) ? 0 : this.message.hashCode());
result = prime * result + ((this.priority == null) ? 0 : this.priority.hashCode());
result = prime * result + ((this.errorEvent == null) ? 0 : this.errorEvent.hashCode());
result = prime * result + ((this.tags == null) ? 0 : java.util.Arrays.hashCode(this.tags));
return result;
}
}