クラス ClassUtils

java.lang.ObjectSE
org.springframework.data.repository.util.ClassUtils

public abstract class ClassUtils extends ObjectSE
クラスを操作するユーティリティクラス。
作成者:
Oliver Gierke, Mark Paluch, Johannes Englmeier
  • メソッドの詳細

    • hasProperty

      public static boolean hasProperty(ClassSE<?> type, StringSE property)
      指定されたクラスに指定された名前のプロパティが含まれているかどうかを返します。
      パラメーター:
      type -
      property -
      戻り値:
    • ifPresent

      public static void ifPresent(StringSE className, @Nullable ClassLoaderSE classLoader, ConsumerSE<ClassSE<?>> action)
      提供された className によって識別される ClassSE が存在するかどうかを判断し *、ロードできるかどうかを判断し、ClassSE をロードできる場合は actionSE を呼び出します。
      パラメーター:
      className - チェックするクラスの名前。
      classLoader - 使用するクラスローダー。
      action - 通知するアクションコールバック。(デフォルトのクラスローダーを示す null の場合があります)
      例外:
      IllegalStateExceptionSE - 対応するクラスは解決可能であるが、クラスの継承階層に可読性の不一致があった場合 (通常、ここでチェックされるクラスによって実装されるスーパークラスまたはインターフェースの Jigsaw モジュール定義に欠落している依存関係宣言)
    • isGenericRepositoryInterface

      public static boolean isGenericRepositoryInterface(ClassSE<?> interfaze)
      指定された型が Repository インターフェースである場合に戻ります。
      パラメーター:
      interfaze -
      戻り値:
    • isGenericRepositoryInterface

      public static boolean isGenericRepositoryInterface(@Nullable StringSE interfaceName)
      指定された型名がリポジトリインターフェース名であるかどうかを返します。
      パラメーター:
      interfaceName -
      戻り値:
    • getNumberOfOccurences

      @DeprecatedSE public static int getNumberOfOccurences(MethodSE method, ClassSE<?> type)
      使用すべきではありません。
    • getNumberOfOccurrences

      public static int getNumberOfOccurrences(@NonNull MethodSE method, @NonNull ClassSE<?> parameterType)
      指定された MethodSE 内の指定された parameter type の出現回数を返します。
      パラメーター:
      method - 評価する MethodSE
      parameterType - カウントする MethodSE パラメーター・型の ClassSE
      戻り値:
      指定された MethodSE 内の指定された parameter type の出現回数。
      関連事項:
    • assertReturnTypeAssignable

      public static void assertReturnTypeAssignable(MethodSE method, ClassSE<?>... types)
      指定された MethodSE の戻り値の型が指定された型の 1 つであることを表明します。割り当てチェックの前に既知のラッパー型をアンラップします(QueryExecutionConverters を参照)。
      パラメーター:
      method - null であってはなりません。
      types - null または空であってはなりません。
    • isOfType

      public static boolean isOfType(@Nullable ObjectSE object, CollectionSE<ClassSE<?>> types)
      指定されたオブジェクトが指定された型のいずれかであるかどうかを返します。null の場合は false を返します。
      パラメーター:
      object -
      types -
      戻り値:
    • hasParameterOfType

      public static boolean hasParameterOfType(MethodSE method, ClassSE<?> type)
      指定された MethodSE に指定された型のパラメーターがあるかどうかを返します。
      パラメーター:
      method -
      type -
      戻り値:
    • hasParameterAssignableToType

      public static boolean hasParameterAssignableToType(MethodSE method, ClassSE<?> type)
      指定された MethodSE に、指定された型に割り当て可能なパラメーターがあるかどうかを返します。
      パラメーター:
      method -
      type -
      戻り値:
    • unwrapReflectionException

      public static void unwrapReflectionException(ExceptionSE ex) throws ThrowableSE
      リフレクション呼び出し中に発生する可能性のある元の例外を抽出するヘルパーメソッド。
      パラメーター:
      ex -
      例外:
      ThrowableSE