/*
* Copyright 2014-2016 CyberVision, Inc.
*
* 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.
*/
package org.kaaproject.kaa.common.dto.logs;
import org.kaaproject.kaa.common.dto.HasId;
import java.io.Serializable;
public class LogEventDto implements HasId, Serializable {
private static final long serialVersionUID = 4793296986403052115L;
private String id;
private String header;
private String event;
public LogEventDto() {
}
public LogEventDto(String header, String event) {
this.header = header;
this.event = event;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getEvent() {
return event;
}
public void setEvent(String event) {
this.event = event;
}
public String getHeader() {
return header;
}
public void setHeader(String header) {
this.header = header;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((event == null) ? 0 : event.hashCode());
result = prime * result + ((header == null) ? 0 : header.hashCode());
result = prime * result + ((id == null) ? 0 : id.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;
}
LogEventDto other = (LogEventDto) obj;
if (event == null) {
if (other.event != null) {
return false;
}
} else if (!event.equals(other.event)) {
return false;
}
if (header == null) {
if (other.header != null) {
return false;
}
} else if (!header.equals(other.header)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
return true;
}
@Override
public String toString() {
return "LogEventDto [id=" + id + ", header=" + header + ", event=" + event + "]";
}
}