package com.uas.search.console.b2b.jms;

import java.util.Objects;

/**
 * 各个表的数据改动信息（为了实时更新索引，关于各个表的数据更改记录存储在AQ消息队列中）
 * 
 * @author sunyj
 * @since 2016年12月1日 下午3:05:22
 */
public class LuceneQueueMessage {

	/**
	 * 在表中的id
	 */
	private String messageId;

	/**
	 * 更改发生的表
	 */
	private String tableName;

	/**
	 * 更改发生的数据的id
	 */
	private String ids;

	/**
	 * 更改发生的数据
	 */
	private String data;

	/**
	 * 更改的类型，INSERT、UPDATE、DELETE
	 */
	private String method;

	/**
	 * 更改发生的时间
	 */
	private String modifyTime;

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(String modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null || getClass() != obj.getClass() || !(obj instanceof LuceneQueueMessage)) {
			return false;
		}
		LuceneQueueMessage other = (LuceneQueueMessage) obj;
		return Objects.equals(messageId, other.getMessageId()) && Objects.equals(tableName, other.getTableName())
				&& Objects.equals(ids, other.getIds()) && Objects.equals(data, other.getData())
				&& Objects.equals(method, other.getMethod()) && Objects.equals(modifyTime, other.getModifyTime());
	}

	@Override
	public String toString() {
		return "LuceneQueueMessage [messageId=" + messageId + ", tableName=" + tableName + ", ids=" + ids + ", data="
				+ data + ", method=" + method + ", modifyTime=" + modifyTime + "]";
	}

}
