Annotation Type Before


  • @Target(PARAMETER)
    @Retention(RUNTIME)
    public @interface Before
    Sets the parameter to the object before the specified class in the cause chain. An additional check is done to ensure that the object is of the correct type.
    See Also:
    Cause.before(Class)
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<?> value
      Gets the class to use with Cause.before(Class).
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean inverse
      If true then the behavior of the typeFilter is reversed and the specified types are excluded rather than included.
      java.lang.Class<?>[] typeFilter
      If specified the possible type for the returned object (normally specified by the type of the annotated parameter) is restricted to only the specified types.
    • Element Detail

      • value

        java.lang.Class<?> value
        Gets the class to use with Cause.before(Class).
        Returns:
        The class to use
      • typeFilter

        java.lang.Class<?>[] typeFilter
        If specified the possible type for the returned object (normally specified by the type of the annotated parameter) is restricted to only the specified types.

        For exampled annotating a parameter of type Monster would normally accept all entities extending Monster, however with the includes specified as Enderman and Zombie the possible Monsters returned would be restricted to entities extending either Enderman and Zombie.

        Returns:
        The included classes, if empty then the type is not restricted
        Default:
        {}
      • inverse

        boolean inverse
        If true then the behavior of the typeFilter is reversed and the specified types are excluded rather than included.
        Returns:
        If the type filter is reversed
        Default:
        false