All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xpertss.ds.concurrent.ConditionFactory Maven / Gradle / Ivy

Go to download

A modern high speed connection pool that supports multiple connection types.

There is a newer version: 2.6
Show newest version
package xpertss.ds.concurrent;


public class ConditionFactory {

   public static Condition equal(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current == value;
         }
      };
   }

   public static Condition notEqual(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current != value;
         }
      };
   }

   public static Condition lessThan(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current < value;
         }
      };
   }
   
   public static Condition lessThanEqual(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current <= value;
         }
      };
   }

   public static Condition greaterThan(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current > value;
         }
      };
   }
   
   public static Condition greaterThanEqual(final long value)
   {
      return new Condition() {
         public boolean evaluate(long current)
         {
            return current >= value;
         }
      };
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy