Uses of Annotation Interface
org.springframework.lang.Contract
Packages that use Contract
Package
Description
Support for AOP-based scoping of target objects, with configurable backend.
Convenience classes for using Spring's AOP API.
Support package for annotation-driven bean configuration.
Core support package for annotations, meta-annotations, and merged
annotations with attribute overrides.
Type conversion system API.
SpEL's central implementation package.
General utility classes for use in unit and integration tests.
Miscellaneous utility classes, such as utilities for working with strings,
classes, collections, reflection, etc.
Useful generic
java.util.function helper classes.-
Uses of Contract in org.springframework.aop.scope
Methods in org.springframework.aop.scope with annotations of type ContractModifier and TypeMethodDescriptionstatic booleanScopedProxyUtils.isScopedTarget(@Nullable String beanName) Determine if thebeanNameis the name of a bean that references the target bean within a scoped proxy. -
Uses of Contract in org.springframework.aop.support
Methods in org.springframework.aop.support with annotations of type ContractModifier and TypeMethodDescriptionstatic booleanAopUtils.isAopProxy(@Nullable Object object) Check whether the given object is a JDK dynamic proxy or a CGLIB proxy.static booleanAopUtils.isCglibProxy(@Nullable Object object) Check whether the given object is a CGLIB proxy.static booleanAopUtils.isJdkDynamicProxy(@Nullable Object object) Check whether the given object is a JDK dynamic proxy. -
Uses of Contract in org.springframework.beans.factory.annotation
Methods in org.springframework.beans.factory.annotation with annotations of type ContractModifier and TypeMethodDescriptionstatic booleanInjectionMetadata.needsRefresh(@Nullable InjectionMetadata metadata, Class<?> clazz) Check whether the given injection metadata needs to be refreshed. -
Uses of Contract in org.springframework.core.annotation
Methods in org.springframework.core.annotation with annotations of type Contract -
Uses of Contract in org.springframework.core.convert
Methods in org.springframework.core.convert with annotations of type ContractModifier and TypeMethodDescriptionstatic @Nullable TypeDescriptorTypeDescriptor.array(@Nullable TypeDescriptor elementTypeDescriptor) Create a new type descriptor as an array of the specified type.static @Nullable TypeDescriptorCreate a new type descriptor for an object. -
Uses of Contract in org.springframework.expression.spel
Methods in org.springframework.expression.spel with annotations of type ContractModifier and TypeMethodDescriptionstatic booleanCodeFlow.isBooleanCompatible(@Nullable String descriptor) Determine whether the descriptor is for a boolean primitive or boolean reference type.static booleanCodeFlow.isIntegerForNumericOp(Number number) Determine whether the given number is to be considered as an integer for the purposes of a numeric operation at the bytecode level.static booleanCodeFlow.isPrimitive(@Nullable String descriptor) Determine whether the descriptor is for a primitive type orvoid.static booleanCodeFlow.isPrimitiveArray(@Nullable String descriptor) Determine whether the descriptor is for a primitive array (for example, "[[I").static booleanCodeFlow.isPrimitiveOrUnboxableSupportedNumber(@Nullable String descriptor) Determine if the supplied descriptor is for a supported number.static booleanCodeFlow.isPrimitiveOrUnboxableSupportedNumberOrBoolean(@Nullable String descriptor) Determine if the supplied descriptor is for a supported number type or boolean. -
Uses of Contract in org.springframework.test.util
Methods in org.springframework.test.util with annotations of type ContractModifier and TypeMethodDescriptionstatic voidAssertionErrors.assertFalse(String message, boolean condition) Assert the given condition isfalseand raise anAssertionErrorotherwise.static voidAssertionErrors.assertNotNull(String message, @Nullable Object object) Assert that the given object is notnulland raise anAssertionErrorotherwise.static voidAssertionErrors.assertNull(String message, @Nullable Object object) Assert that the given object isnulland raise anAssertionErrorotherwise.static voidAssertionErrors.assertTrue(String message, boolean condition) Assert the given condition istrueand raise anAssertionErrorotherwise.static voidFail a test with the given message. -
Uses of Contract in org.springframework.util
Methods in org.springframework.util with annotations of type ContractModifier and TypeMethodDescriptionstatic intStreamUtils.drain(@Nullable InputStream in) Drain the remaining content of the given InputStream.static voidAssert that the given String is not empty; that is, it must not benulland not the empty String.static voidAssert that the given String is not empty; that is, it must not benulland not the empty String.static booleanStringUtils.hasLength(@Nullable CharSequence str) Check that the givenCharSequenceis neithernullnor of length 0.static booleanCheck that the givenStringis neithernullnor of length 0.static voidAssert that the given String contains valid text content; that is, it must not benulland must contain at least one non-whitespace character.static voidAssert that the given String contains valid text content; that is, it must not benulland must contain at least one non-whitespace character.static booleanStringUtils.hasText(@Nullable CharSequence str) Check whether the givenCharSequencecontains actual text.static booleanCheck whether the givenStringcontains actual text.static booleanDetermine whether the given object is an array: either an Object array or a primitive array.static voidAssert.isAssignable(Class<?> superType, @Nullable Class<?> subType) Assert thatsuperType.isAssignableFrom(subType)istrue.static voidAssert.isAssignable(Class<?> superType, @Nullable Class<?> subType, String message) Assert thatsuperType.isAssignableFrom(subType)istrue.static voidAssert.isAssignable(Class<?> superType, @Nullable Class<?> subType, Supplier<String> messageSupplier) Assert thatsuperType.isAssignableFrom(subType)istrue.static booleanCollectionUtils.isEmpty(@Nullable Collection<? extends @Nullable Object> collection) Returntrueif the supplied Collection isnullor empty.static booleanReturntrueif the supplied Map isnullor empty.static booleanDetermine whether the given object is empty.static booleanDetermine whether the given array is empty: i.e.static voidAssert.isInstanceOf(Class<?> type, @Nullable Object obj) Assert that the provided object is an instance of the provided class.static voidAssert.isInstanceOf(Class<?> type, @Nullable Object obj, String message) Assert that the provided object is an instance of the provided class.static voidAssert that the provided object is an instance of the provided class.static voidAssert that an object isnull.static voidAssert that an object isnull.static voidAssert a boolean expression, throwing anIllegalArgumentExceptionif the expression evaluates tofalse.static voidAssert a boolean expression, throwing anIllegalArgumentExceptionif the expression evaluates tofalse.static voidAssert that an array contains elements; that is, it must not benulland must contain at least one element.static voidAssert that an array contains elements; that is, it must not benulland must contain at least one element.static voidAssert.notEmpty(@Nullable Collection<?> collection, String message) Assert that a collection contains elements; that is, it must not benulland must contain at least one element.static voidAssert.notEmpty(@Nullable Collection<?> collection, Supplier<String> messageSupplier) Assert that a collection contains elements; that is, it must not benulland must contain at least one element.static voidAssert that a Map contains entries; that is, it must not benulland must contain at least one entry.static voidAssert that a Map contains entries; that is, it must not benulland must contain at least one entry.static voidAssert that an object is notnull.static voidAssert that an object is notnull.static booleanObjectUtils.nullSafeEquals(@Nullable Object o1, @Nullable Object o2) Determine if the given objects are equal, returningtrueif both arenullorfalseif only one isnull.static voidAssert a boolean expression, throwing anIllegalStateExceptionif the expression evaluates tofalse.static voidAssert a boolean expression, throwing anIllegalStateExceptionif the expression evaluates tofalse. -
Uses of Contract in org.springframework.util.function
Methods in org.springframework.util.function with annotations of type ContractModifier and TypeMethodDescriptionstatic <T> @Nullable SingletonSupplier<T> SingletonSupplier.ofNullable(@Nullable T instance) Build aSingletonSupplierwith the given singleton instance.static <T> @Nullable SingletonSupplier<T> SingletonSupplier.ofNullable(@Nullable Supplier<@Nullable T> supplier) Build aSingletonSupplierwith the given supplier.static <T> @Nullable TResolve the givenSupplier, getting its result or immediately returningnullif the supplier itself wasnull.