Class InventoryItemAmountMatcher

java.lang.Object
org.hamcrest.BaseMatcher<InventoryMock>
org.hamcrest.TypeSafeMatcher<InventoryMock>
org.mockbukkit.mockbukkit.matcher.inventory.InventoryItemAmountMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<InventoryMock>, org.hamcrest.SelfDescribing

public class InventoryItemAmountMatcher extends org.hamcrest.TypeSafeMatcher<InventoryMock>
  • Constructor Details

    • InventoryItemAmountMatcher

      public InventoryItemAmountMatcher(ItemStack targetItem, int targetAmount)
  • Method Details

    • matchesSafely

      protected boolean matchesSafely(InventoryMock inventoryMock)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<InventoryMock>
    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatchSafely

      public void describeMismatchSafely(InventoryMock inventoryMock, org.hamcrest.Description description)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<InventoryMock>
    • containsAtLeast

      @NotNull public static @NotNull InventoryItemAmountMatcher containsAtLeast(Material material, int amount)
      Parameters:
      material - The material of the items
      amount - The amount of the items required for a match
      Returns:
      A matcher which matches with any inventory with more than the required amount of items
    • containsLessThan

      @NotNull public static @NotNull org.hamcrest.Matcher<InventoryMock> containsLessThan(Material material, int amount)
      Parameters:
      material - The material of the items
      amount - The amount of the items required for no match
      Returns:
      A matcher which matches with any inventory with more than the required amount of items
    • containsAtLeast

      @NotNull public static @NotNull InventoryItemAmountMatcher containsAtLeast(@NotNull @NotNull ItemStack targetItem, int amount)
      Parameters:
      targetItem - The target item
      amount - The amount of the items required for a match
      Returns:
      A matcher which matches with any inventory with more than the required amount of items
    • containsLessThan

      @NotNull public static @NotNull org.hamcrest.Matcher<InventoryMock> containsLessThan(@NotNull @NotNull ItemStack targetItem, int amount)
      Parameters:
      targetItem - The target item
      amount - The amount of the items required for no match
      Returns:
      A matcher which matches with any inventory with lower than the given amount of items