Class HasAtLeastSizeMatcher

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<Collection<?>>
com.atlassian.bamboo.utils.HasAtLeastSizeMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<Collection<?>>, org.hamcrest.SelfDescribing

public class HasAtLeastSizeMatcher extends org.hamcrest.TypeSafeMatcher<Collection<?>>
A custom matcher that checks if a collection has at least a specified minimum size.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HasAtLeastSizeMatcher(int minSize)
    Constructs a matcher that checks if a collection has at least the specified minimum size.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describeTo(org.hamcrest.Description description)
    Describes the matcher.
    hasAtLeastSize(int minSize)
    A static factory method to create an instance of the matcher.
    protected boolean
    Checks if the collection has at least the specified minimum size.

    Methods inherited from class org.hamcrest.TypeSafeMatcher

    describeMismatch, describeMismatchSafely, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, toString

    Methods inherited from class java.lang.Object

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

    • HasAtLeastSizeMatcher

      public HasAtLeastSizeMatcher(int minSize)
      Constructs a matcher that checks if a collection has at least the specified minimum size.
      Parameters:
      minSize - the minimum size the collection should have
  • Method Details

    • matchesSafely

      protected boolean matchesSafely(Collection<?> item)
      Checks if the collection has at least the specified minimum size.
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<Collection<?>>
      Parameters:
      item - the collection to check
      Returns:
      true if the collection has at least the specified minimum size, false otherwise
    • describeTo

      public void describeTo(org.hamcrest.Description description)
      Describes the matcher.
      Parameters:
      description - the description to be appended
    • hasAtLeastSize

      public static HasAtLeastSizeMatcher hasAtLeastSize(int minSize)
      A static factory method to create an instance of the matcher.
      Parameters:
      minSize - the minimum size the collection should have
      Returns:
      an instance of HasAtLeastSizeMatcher