Class Bucket

java.lang.Object
com.yetnt.utils.collection.buckets.Bucket

public class Bucket extends Object
A utility class that acts as a container for a set of Class objects. It provides a method to check if a given object is an instance of the classes held within the bucket.

From Jaiva!

Author:
Lehlogonolo Poole
See Also:
  • Field Details

    • cls

      private Class<?>[] cls
  • Constructor Details

    • Bucket

      public Bucket(Class<?>... classes)
      Default Constructor to create a bucket with multiple Class stuff
      Parameters:
      classes - Classes
  • Method Details

    • shouldHold

      public boolean shouldHold(Object t)
      Whether the object t is a type of the classes this bucket holds.
      Parameters:
      t - The object to check against
      Returns:
      true if clazz.isInstance(t) of any which of the classes in this bucket holds passes, or false otherwise