Class ChecksKt

  • All Implemented Interfaces:

    
    public final class ChecksKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> Unit requireNotBlank(T $self, KProperty1<T, CharSequence> field)
      final static <T extends Any> Unit requireNotBlanks(T $self, KProperty1<T, Collection<CharSequence>> field)
      final static <T extends Any, N extends Any> Unit requireGreater(T $self, KProperty1<T, Comparable<N>> field, N min)
      final static <T extends Any, N extends Any> Unit requireGreater(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      final static <T extends Any, N extends Any> Unit requireGreaterOrEquals(T $self, KProperty1<T, Comparable<N>> field, N min)
      final static <T extends Any, N extends Any> Unit requireGreaterOrEquals(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      final static <T extends Any, N extends Any> Unit requireLower(T $self, KProperty1<T, Comparable<N>> field, N min)
      final static <T extends Any, N extends Any> Unit requireLower(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      final static <T extends Any, N extends Any> Unit requireLowerOrEquals(T $self, KProperty1<T, Comparable<N>> field, N min)
      final static <T extends Any, N extends Any> Unit requireLowerOrEquals(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      final static <Z extends Any> Collection<Z> checkSize(Collection<Z> $self, IntRange count) Ensure a collection has a fixed number of elements.
      final static Unit check(String message, Function0<Unit> blocks) Execute a list of code block collecting the exceptions they may throw, in case there is any error, it throws a MultipleException with all the thrown exceptions.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • requireNotBlank

         final static <T extends Any> Unit requireNotBlank(T $self, KProperty1<T, CharSequence> field)
      • requireNotBlanks

         final static <T extends Any> Unit requireNotBlanks(T $self, KProperty1<T, Collection<CharSequence>> field)
      • requireGreater

         final static <T extends Any, N extends Any> Unit requireGreater(T $self, KProperty1<T, Comparable<N>> field, N min)
      • requireGreater

         final static <T extends Any, N extends Any> Unit requireGreater(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      • requireGreaterOrEquals

         final static <T extends Any, N extends Any> Unit requireGreaterOrEquals(T $self, KProperty1<T, Comparable<N>> field, N min)
      • requireGreaterOrEquals

         final static <T extends Any, N extends Any> Unit requireGreaterOrEquals(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      • requireLower

         final static <T extends Any, N extends Any> Unit requireLower(T $self, KProperty1<T, Comparable<N>> field, N min)
      • requireLower

         final static <T extends Any, N extends Any> Unit requireLower(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      • requireLowerOrEquals

         final static <T extends Any, N extends Any> Unit requireLowerOrEquals(T $self, KProperty1<T, Comparable<N>> field, N min)
      • requireLowerOrEquals

         final static <T extends Any, N extends Any> Unit requireLowerOrEquals(T $self, KProperty1<T, Comparable<N>> field, KProperty1<T, N> field2)
      • checkSize

         final static <Z extends Any> Collection<Z> checkSize(Collection<Z> $self, IntRange count)

        Ensure a collection has a fixed number of elements.

        Parameters:
        count - Required number of elements.
        Returns:

        Receiver reference (to allow call chaining).

      • check

         final static Unit check(String message, Function0<Unit> blocks)

        Execute a list of code block collecting the exceptions they may throw, in case there is any error, it throws a MultipleException with all the thrown exceptions.

        Parameters:
        message - Error message.
        blocks - Blocks of code executed and checked.