Class InstanceOf

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  InstanceOf.VarArgAware  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> clazz  
      private java.lang.String description  
    • Constructor Summary

      Constructors 
      Constructor Description
      InstanceOf​(java.lang.Class<?> clazz)  
      InstanceOf​(java.lang.Class<?> clazz, java.lang.String describedAs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(java.lang.Object actual)
      Informs if this matcher accepts the given argument.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • clazz

        private final java.lang.Class<?> clazz
      • description

        private final java.lang.String description
    • Constructor Detail

      • InstanceOf

        public InstanceOf​(java.lang.Class<?> clazz)
      • InstanceOf

        public InstanceOf​(java.lang.Class<?> clazz,
                          java.lang.String describedAs)
    • Method Detail

      • matches

        public boolean matches​(java.lang.Object actual)
        Description copied from interface: ArgumentMatcher
        Informs if this matcher accepts the given argument.

        The method should never assert if the argument doesn't match. It should only return false.

        See the example in the top level javadoc for ArgumentMatcher

        Specified by:
        matches in interface ArgumentMatcher<java.lang.Object>
        Parameters:
        actual - the argument
        Returns:
        true if this matcher accepts the given argument.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object