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

org.infinispan.commons.configuration.attributes.AttributeValidator Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.configuration.attributes;

import org.infinispan.commons.logging.Log;

/**
 * AttributeValidator.
 *
 * @author Tristan Tarrant
 * @since 7.2
 */
@FunctionalInterface
public interface AttributeValidator {
   void validate(T value);

   static  AttributeValidator greaterThanZero(Enum attribute) {
      return value -> {
         if (value.intValue() < 1) {
            throw Log.CONFIG.attributeMustBeGreaterThanZero(value.intValue(), attribute);
         }
      };
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy