Home | History | Annotate | Download | only in mockito
      1 /*
      2  * Copyright (c) 2017 Mockito contributors
      3  * This program is made available under the terms of the MIT License.
      4  */
      5 package org.mockito;
      6 
      7 import java.lang.annotation.Documented;
      8 import java.lang.annotation.Retention;
      9 import java.lang.annotation.RetentionPolicy;
     10 
     11 /**
     12  * Indicates to the user that she should not provide custom implementations of given type.
     13  * Helps framework integrators and our users understand how to use Mockito API safely,
     14  * without the risk of getting exposed to incompatible changes.
     15  * Some types that are a part of Mockito public API are not intended to be extended.
     16  * It's because Mockito team needs to be able to add new methods to some types without breaking compatibility contract.
     17  * We would never break compatibility by changing the signature of an existing public method.
     18  * However, we need flexibility to add new methods to some types to evolve the API if needed.
     19  * Public types are all types that are *not* under "org.mockito.internal.*" package.
     20  * <p>
     21  * Absence of {@code NotExtensible} annotation on a type *does not* mean it is intended to be extended.
     22  * The annotation has been introduced late and therefore it is not used frequently in the codebase.
     23  * Many public types from Mockito API are not intended for extension, even though they do not have this annotation applied.
     24  *
     25  * @since 2.10.0
     26  */
     27 @Retention(RetentionPolicy.RUNTIME)
     28 @Documented
     29 public @interface NotExtensible {
     30 }
     31