Class ItemSimilarityMatcher

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

public class ItemSimilarityMatcher extends org.hamcrest.TypeSafeMatcher<ItemStack>
  • Constructor Details

    • ItemSimilarityMatcher

      public ItemSimilarityMatcher(ItemStack itemStack)
  • Method Details

    • matchesSafely

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

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

      public void describeMismatchSafely(ItemStack itemStack, org.hamcrest.Description description)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<ItemStack>
    • similarTo

      @NotNull public static @NotNull ItemSimilarityMatcher similarTo(@NotNull @NotNull ItemStack itemStack)
      Matches when two item stacks are similar to each other using the ItemStack.isSimilar(ItemStack) method
      Parameters:
      itemStack - The required item stack to be similar to for a match
      Returns:
      A matcher which matches when an item stack is similar to the specified item stack
    • similarTo

      @NotNull public static @NotNull ItemSimilarityMatcher similarTo(@NotNull @NotNull Material itemMaterial)
      Matches when two item stacks are similar to each other using the ItemStack.isSimilar(ItemStack) method
      Parameters:
      itemMaterial - The required material of the item stack to be similar to for a match
      Returns:
      A matcher which matches when an item stack is similar to the specified item stack