Class ClassMatcher

java.lang.Object
org.opentcs.util.ClassMatcher
All Implemented Interfaces:
java.io.Serializable, java.util.function.Predicate<java.lang.Object>

public class ClassMatcher
extends java.lang.Object
implements java.util.function.Predicate<java.lang.Object>, java.io.Serializable
Checks whether the input argument is assignable to any of a given set of classes.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    ClassMatcher​(java.lang.Class<?>... events)
    Creates a new instance.
  • Method Summary

    Modifier and Type Method Description
    java.util.function.Predicate<java.lang.Object> negate()  
    boolean test​(java.lang.Object object)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, or
  • Constructor Details

    • ClassMatcher

      public ClassMatcher​(java.lang.Class<?>... events)
      Creates a new instance.
      Parameters:
      events - The set of classes to evaluate incoming events to.
  • Method Details

    • test

      public boolean test​(java.lang.Object object)
      Specified by:
      test in interface java.util.function.Predicate<java.lang.Object>
    • negate

      public java.util.function.Predicate<java.lang.Object> negate()
      Specified by:
      negate in interface java.util.function.Predicate<java.lang.Object>