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

com.patternity.graphic.behavioral.Message Maven / Gradle / Ivy

Go to download

Extensions of the RestFixture. An extension is a RestFixture with some specific/bespoke behaviour not generic enough to make it to the RestFixture itself.

There is a newer version: 3.1
Show newest version
package com.patternity.graphic.behavioral;

/**
 * Represents a message being sent to a target agent
 * 
 * @author cyrille martraire
 */
public class Message extends Event {

	private final String method;

	private final String result;

	public static final int SYNC = 0;

	public static final int ASYNC = 1;

	public static final int CREATE = 2;

	public static final int DESTROY = 3;

	public Message(Agent target, String method) {
		this(SYNC, target, method, null);
	}

	public Message(int kind, Agent target, String method, String result) {
		super(kind, target);
		this.method = method;
		this.result = result;
	}

	public String getMethod() {
		return method;
	}

	public String getResult() {
		return result;
	}

	public boolean isCreation() {
		return getKind() == CREATE;
	}

	public boolean isAsync() {
		return getKind() == ASYNC;
	}

	public boolean isDestroy() {
		return getKind() == DESTROY;
	}

	public String toString() {
		return getTarget() + "." + getMethod();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy