Annotation Interface Contract


@Documented @Retention(CLASS) @Target(TYPE) public @interface Contract
The Contract annotation is used to relay significance to the type that it annotates. While remaining optional in its use, it is typically placed on an interface definition to signify that the given type can be used for lookup in the Services registry, and be eligible for injection via standard @Inject. While normally placed on interface types, it can also be placed on abstract and concrete class as well. The main point is that a Contract is the focal point for service lookup and injection.

If the developer does not have access to the source to place this annotation on the interface definition directly then consider using ExternalContracts instead - this annotation can be placed on the implementation class implementing the given Contract interface(s).

See Also:
  • ServiceInfoBasicsBlueprint.contractsImplemented()
  • ServiceInfoBlueprint.externalContractsImplemented()