Class Preconditions

java.lang.Object
enterprises.iwakura.sigewine.utils.Preconditions

public final class Preconditions extends Object
Utility class providing common validation methods for the Sigewine framework.

This class contains static methods to validate various conditions, such as the presence of constructors, annotations, and method return types.

  • Method Details

    • checkNoArgConstructor

      public static void checkNoArgConstructor(Class<?> clazz)
      Validates that the class has a no-argument constructor.
      Parameters:
      clazz - The class to validate.
      Throws:
      IllegalArgumentException - if the class does not have a no-argument constructor.
    • checkOneConstructor

      public static void checkOneConstructor(Class<?> clazz)
      Checks if the class has exactly one constructor.
      Parameters:
      clazz - Class to check
      Throws:
      IllegalArgumentException - if the class does not have exactly one constructor
    • checkNoVoidReturnType

      public static void checkNoVoidReturnType(Method method)
      Checks if the method has a void return type.
      Parameters:
      method - Method to check
      Throws:
      IllegalArgumentException - if the method has a void return type
    • checkNoPrimitiveReturnType

      public static void checkNoPrimitiveReturnType(Method method)
      Checks if the method has a primitive return type.
      Parameters:
      method - Method to check
      Throws:
      IllegalArgumentException - if the method has a primitive return type
    • checkAnnotated

      public static void checkAnnotated(Class<?> clazz, Class<RomaritimeBean> romaritimeClass)
      Checks if the class is annotated with the specified annotation.
      Parameters:
      clazz - Class to check
      romaritimeClass - Annotation class to check
    • isOfType

      public static <E> void isOfType(Object object, Class<E> type)
      Checks if the class is annotated with the specified annotation.
      Type Parameters:
      E - Type of the class
      Parameters:
      object - Object to check
      type - Class to check