/*
 * Copyright (C) 2018, nitro ventures GmbH
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms
 * of the MIT license. See the LICENSE file for details.
 */

package ai.nitro.bot4j.middle.receive.listener;

import ai.nitro.bot4j.middle.domain.receive.ReceiveMessage;

public abstract class MessageReceiveListener implements Comparable<MessageReceiveListener> {

	@Override
	public int compareTo(final MessageReceiveListener l) {
		return l.getPriority().compareTo(this.getPriority());
	}

	public Integer getPriority() {
		return 0;
	}

	public abstract void onAfterReceiveMessage(ReceiveMessage receiveMessage);

	public abstract void onBeforeReceiveMessage(ReceiveMessage receiveMessage);

	@Override
	public String toString() {
		return getClass().getSimpleName();
	}
}
