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

org.cg.eventbus.message.Message Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package org.cg.eventbus.message;

import java.util.Arrays;

/**
 * 
 * @author liang.li
 *
 */
public class Message {

	private String mTopic;
	private long mOffset;
	private byte[] mKey;
	private byte[] mPayload;
	private int mPartition;

	public Message(String topic, long offset, byte[] key, byte[] payload, int partition) {
		super();
		this.mTopic = topic;
		this.mOffset = offset;
		this.mKey = key;
		this.mPayload = payload;
		this.mPartition = partition;
	}
	
	public Message(String topic, long offset, byte[] key, byte[] payload) {
		super();
		this.mTopic = topic;
		this.mOffset = offset;
		this.mKey = key;
		this.mPayload = payload;
	}

	public String getTopic() {
		return this.mTopic;
	}

	public long getOffset() {
		return this.mOffset;
	}

	public byte[] getKey() {
		return this.mKey;
	}

	public byte[] getPayload() {
		return this.mPayload;
	}

	public int getPartition() {
		return this.mPartition;
	}

	@Override
	public String toString() {
		return "Message [Topic=" + mTopic + ", Offset=" + mOffset + ", Key=" + Arrays.toString(mKey) + ", Payload="
				+ Arrays.toString(mPayload) + ", Partition=" + mPartition + "]";
	}
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy