Class NotInsideContainerException

  • All Implemented Interfaces:
    java.io.Serializable

    public class NotInsideContainerException
    extends java.lang.IllegalStateException
    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.
    See Also:
    Serialized Form
    No Inspection:
    UncheckedExceptionClass
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable GameObjectContainer<?,​?,​?> getContainer()
      Returns the container that the GameObject was expected in.
      @NotNull BaseObject<?,​?,​?,​?> getItem()
      Returns the game object that was not inside a container but should have been.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NotInsideContainerException

        public NotInsideContainerException​(@NotNull
                                           @NotNull GameObject<?,​?,​?> item)
        Creates a new instance.
        Parameters:
        item - GameObject that was not inside a container but should have been.
      • NotInsideContainerException

        public NotInsideContainerException​(@Nullable
                                           @Nullable GameObjectContainer<?,​?,​?> container,
                                           @NotNull
                                           @NotNull GameObject<?,​?,​?> item)
        Creates a new instance.
        Parameters:
        container - Container that was queried or null if a container was expected but not found.
        item - GameObject that was not inside a container but should have been.
    • Method Detail

      • getItem

        @NotNull
        public @NotNull BaseObject<?,​?,​?,​?> 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
      • getContainer

        @Nullable
        public @Nullable GameObjectContainer<?,​?,​?> 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