Package 

Class DataBuilder


  • 
    public final class DataBuilder
    
                        

    Class for building data matchers

    This class helps to build matches for data. Please note that any function invoking will add specific matcher to the list and after that all of them will be combined with help of AllOf.allOf()

    • Constructor Summary

      Constructors 
      Constructor Description
      DataBuilder()
    • Method Summary

      Modifier and Type Method Description
      final Unit isInstanceOf(Class<?> clazz) Matches data whose class matches given class
      final Unit equals(Object obj) Matches data which is equal to given object
      final Unit notEquals(Object obj) Matches data which is not equal to given object
      final Unit withMatcher(Matcher<Object> matcher) Matches data with given custom matcher
      final Matcher<Object> getDataMatcher() Returns combined data matchers with AllOf.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataBuilder

        DataBuilder()
    • Method Detail

      • isInstanceOf

         final Unit isInstanceOf(Class<?> clazz)

        Matches data whose class matches given class

        Parameters:
        clazz - Class to be matched
      • equals

         final Unit equals(Object obj)

        Matches data which is equal to given object

        Parameters:
        obj - Any object that needs to be matched
      • notEquals

         final Unit notEquals(Object obj)

        Matches data which is not equal to given object

        Parameters:
        obj - Any object that needs to be matched
      • withMatcher

         final Unit withMatcher(Matcher<Object> matcher)

        Matches data with given custom matcher

        Parameters:
        matcher - Custom matcher to be added
      • getDataMatcher

         final Matcher<Object> getDataMatcher()

        Returns combined data matchers with AllOf.allOf()