Package madkit.kernel

# Enum Class AbstractAgent.ReturnCode

java.lang.Object
java.lang.Enum<AbstractAgent.ReturnCode>
madkit.kernel.AbstractAgent.ReturnCode

All Implemented Interfaces:
  `Serializable`, `Comparable<AbstractAgent.ReturnCode>`, `java.lang.constant.Constable`

Enclosing class:
  AbstractAgent

public static enum AbstractAgent.ReturnCode extends Enum<AbstractAgent.ReturnCode>
This class enumerates all the return codes which could be obtained with essential methods of the `AbstractAgent` and `Agent` classes.

Since:
  MaDKit 5.0
Author:
  Fabien Michel

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ACCESS_DENIED`
  Returned when requesting a role in a secured group fails
  `AGENT_CRASH`
  Returned by launch primitives when the launched agent crashes in activate
  `ALREADY_GROUP`
  Returned when using `AbstractAgent.createGroup(String, String, boolean, Gatekeeper)` and that a group already exists
  `ALREADY_KILLED`
  Returned by kill primitives when the targeted agent is already terminated
  `ALREADY_LAUNCHED`
  Returned when launching an agent which is already launched
  `CANT_REPLY`
  Returned when an agent tries to reply to a message which has not been received from another agent, e.g. newly created or sent directly by an object using `AbstractAgent.receiveMessage(Message)`.
  `IGNORED`
  Returned when `AbstractAgent.requestRole(String, String, String, Object)` or `AbstractAgent.createGroup(String, String, boolean, Gatekeeper)` is used in activate and that the agent has been launched using `AbstractAgent.launchAgentBucket(List, String...)` or `AbstractAgent.launchAgentBucket(String, int, String...)`
  `INVALID_AGENT_ADDRESS`
  Returned by send primitives when the targeted agent address does not exist anymore, i.e. the related agent has leaved the corresponding role
  `NO_RECIPIENT_FOUND`
  Returned by send primitives when the targeted CGR location does not exist or contain any agent
  `NOT_COMMUNITY`
  Indicates that a community does not exist
  `NOT_GROUP`
  Indicates that a group does not exist
  `NOT_IN_GROUP`
  Indicates that the agent is not in a group
  `NOT_ROLE`
  Indicates that a role does not exist
  `NOT_YET_LAUNCHED`
  Returned by kill primitives when the targeted agent has not been launched priorly
  `ROLE_ALREADY_HANDLED`
  Returned when the agent already has the requested role
  `ROLE_NOT_HANDLED`
  Returned when the agent does not have a role that it is supposed to have doing a particular action, e.g.
  `SEVERE`
  Returned on special errors.
  `SUCCESS`
  `TIMEOUT`
  Returned by various timed primitives of the Agent class like `Agent.sendMessageAndWaitForReply(AgentAddress, Message)` or `AbstractAgent.launchAgent(AbstractAgent, int, boolean)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  `static AbstractAgent.ReturnCode`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static AbstractAgent.ReturnCode[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### SUCCESS

    public static final AbstractAgent.ReturnCode SUCCESS

  - ### NOT_COMMUNITY

    public static final AbstractAgent.ReturnCode NOT_COMMUNITY
    Indicates that a community does not exist

  - ### NOT_GROUP

    public static final AbstractAgent.ReturnCode NOT_GROUP
    Indicates that a group does not exist

  - ### NOT_ROLE

    public static final AbstractAgent.ReturnCode NOT_ROLE
    Indicates that a role does not exist

  - ### NOT_IN_GROUP

    public static final AbstractAgent.ReturnCode NOT_IN_GROUP
    Indicates that the agent is not in a group

  - ### ROLE_ALREADY_HANDLED

    public static final AbstractAgent.ReturnCode ROLE_ALREADY_HANDLED
    Returned when the agent already has the requested role

  - ### ACCESS_DENIED

    public static final AbstractAgent.ReturnCode ACCESS_DENIED
    Returned when requesting a role in a secured group fails

  - ### ROLE_NOT_HANDLED

    public static final AbstractAgent.ReturnCode ROLE_NOT_HANDLED
    Returned when the agent does not have a role that it is supposed to have doing a particular action, e.g. `AbstractAgent.sendMessageWithRole(AgentAddress, Message, String)`

  - ### ALREADY_GROUP

    public static final AbstractAgent.ReturnCode ALREADY_GROUP
    Returned when using `AbstractAgent.createGroup(String, String, boolean, Gatekeeper)` and that a group already exists

  - ### ALREADY_LAUNCHED

    public static final AbstractAgent.ReturnCode ALREADY_LAUNCHED
    Returned when launching an agent which is already launched

  - ### TIMEOUT

    public static final AbstractAgent.ReturnCode TIMEOUT
    Returned by various timed primitives of the Agent class like `Agent.sendMessageAndWaitForReply(AgentAddress, Message)` or `AbstractAgent.launchAgent(AbstractAgent, int, boolean)`

  - ### AGENT_CRASH

    public static final AbstractAgent.ReturnCode AGENT_CRASH
    Returned by launch primitives when the launched agent crashes in activate

  - ### NOT_YET_LAUNCHED

    public static final AbstractAgent.ReturnCode NOT_YET_LAUNCHED
    Returned by kill primitives when the targeted agent has not been launched priorly

  - ### ALREADY_KILLED

    public static final AbstractAgent.ReturnCode ALREADY_KILLED
    Returned by kill primitives when the targeted agent is already terminated

  - ### INVALID_AGENT_ADDRESS

    public static final AbstractAgent.ReturnCode INVALID_AGENT_ADDRESS
    Returned by send primitives when the targeted agent address does not exist anymore, i.e. the related agent has leaved the corresponding role

  - ### NO_RECIPIENT_FOUND

    public static final AbstractAgent.ReturnCode NO_RECIPIENT_FOUND
    Returned by send primitives when the targeted CGR location does not exist or contain any agent

  - ### IGNORED

    public static final AbstractAgent.ReturnCode IGNORED
    Returned when `AbstractAgent.requestRole(String, String, String, Object)` or `AbstractAgent.createGroup(String, String, boolean, Gatekeeper)` is used in activate and that the agent has been launched using `AbstractAgent.launchAgentBucket(List, String...)` or `AbstractAgent.launchAgentBucket(String, int, String...)`

- ### CANT_REPLY

  public static final AbstractAgent.ReturnCode CANT_REPLY
  Returned when an agent tries to reply to a message which has not been received from another agent, e.g. newly created or sent directly by an object using `AbstractAgent.receiveMessage(Message)`.

- ### SEVERE

  public static final AbstractAgent.ReturnCode SEVERE
  Returned on special errors. This should not be encountered

- ## Method Details

  - ### values

    public static AbstractAgent.ReturnCode[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static AbstractAgent.ReturnCode valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Enum<AbstractAgent.ReturnCode>`