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

com.envision.event.api.EventWriteRequest Maven / Gradle / Ivy

The newest version!
package com.envision.event.api;

import com.envision.event.bean.Event;

import java.io.Serializable;

/**
 * 事件写入请求
 * 
 * @author kang.ouyang
 *
 */
public class EventWriteRequest implements Serializable {
	private final Event event;

	public EventWriteRequest(Event event) {
		this.event = event;
	}

	public Event getEvent() {
		return event;
	}

	/**
	 * 写事件需要根据deviceId粘联分配(同一个deviceId的写请求应该分发到同一个服务实例上处理)
	 */
	public int hashCode() {
		if (event == null || event.getDeviceID() == null) {
			return 0;
		}
		return event.getDeviceID().hashCode();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy