Gridarta Editor
net.sf.gridarta.model.gameobject.NotInsideContainerException Class Reference

This exception is thrown in case a method of a GameObject without a container or the wrong container was invoked when a GameObject requires a container. More...

+ Inheritance diagram for net.sf.gridarta.model.gameobject.NotInsideContainerException:
+ Collaboration diagram for net.sf.gridarta.model.gameobject.NotInsideContainerException:

Public Member Functions

GameObjectContainer<?, ?, ?> getContainer ()
 Returns the container that the GameObject was expected in. More...
 
BaseObject<?, ?, ?, ?> getItem ()
 Returns the game object that was not inside a container but should have been. More...
 
 NotInsideContainerException (@NotNull final GameObject<?, ?, ?> item)
 Creates a new instance. More...
 
 NotInsideContainerException (@Nullable final GameObjectContainer<?, ?, ?> container, @NotNull final GameObject<?, ?, ?> item)
 Creates a new instance. More...
 

Private Attributes

final GameObjectContainer<?, ?, ?> container
 The expected container if != null or null if expected to be in any container. More...
 
final BaseObject<?, ?, ?, ?> item
 The GameObject that was not inside a / the container but should have been. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

This exception is thrown in case a method of a GameObject without a container or the wrong container was invoked when a GameObject requires a container.

Author
Christian Hujer @noinspection UncheckedExceptionClass

Definition at line 34 of file NotInsideContainerException.java.

Constructor & Destructor Documentation

◆ NotInsideContainerException() [1/2]

net.sf.gridarta.model.gameobject.NotInsideContainerException.NotInsideContainerException ( @NotNull final GameObject<?, ?, ?>  item)

Creates a new instance.

Parameters
itemGameObject that was not inside a container but should have been.

Definition at line 62 of file NotInsideContainerException.java.

References net.sf.gridarta.model.gameobject.NotInsideContainerException.item.

◆ NotInsideContainerException() [2/2]

net.sf.gridarta.model.gameobject.NotInsideContainerException.NotInsideContainerException ( @Nullable final GameObjectContainer<?, ?, ?>  container,
@NotNull final GameObject<?, ?, ?>  item 
)

Creates a new instance.

Parameters
containerContainer that was queried or
null
if a container was expected but not found.
itemGameObject that was not inside a container but should have been.

Definition at line 73 of file NotInsideContainerException.java.

References net.sf.gridarta.model.gameobject.NotInsideContainerException.container, and net.sf.gridarta.model.gameobject.NotInsideContainerException.item.

Member Function Documentation

◆ getContainer()

GameObjectContainer<?, ?, ?> net.sf.gridarta.model.gameobject.NotInsideContainerException.getContainer ( )

Returns the container that the GameObject was expected in.

Returns
the container the game object was expected in or
null
if it was expected to have any container but had not

Definition at line 96 of file NotInsideContainerException.java.

References net.sf.gridarta.model.gameobject.NotInsideContainerException.container.

◆ getItem()

BaseObject<?, ?, ?, ?> net.sf.gridarta.model.gameobject.NotInsideContainerException.getItem ( )

Returns the game object that was not inside a container but should have been.

Returns
the game object that was not inside a container but should have been

Definition at line 86 of file NotInsideContainerException.java.

References net.sf.gridarta.model.gameobject.NotInsideContainerException.item.

Member Data Documentation

◆ container

final GameObjectContainer<?, ?, ?> net.sf.gridarta.model.gameobject.NotInsideContainerException.container
private

The expected container if != null or null if expected to be in any container.

@serial

Definition at line 47 of file NotInsideContainerException.java.

Referenced by net.sf.gridarta.model.gameobject.NotInsideContainerException.getContainer(), and net.sf.gridarta.model.gameobject.NotInsideContainerException.NotInsideContainerException().

◆ item

final BaseObject<?, ?, ?, ?> net.sf.gridarta.model.gameobject.NotInsideContainerException.item
private

◆ serialVersionUID

final long net.sf.gridarta.model.gameobject.NotInsideContainerException.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 39 of file NotInsideContainerException.java.


The documentation for this class was generated from the following file: