MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsContract­Extensions
Open sandboxFocus

ContractExtensions Class

Fabric extension methods allowing to add NotNullAttribute contracts in bulk and to access options.

Inheritance
System.Object
ContractExtensions
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
[CompileTime]
public static class ContractExtensions : Object

Methods

Name Description
GetContractOptions(IMetaTarget)

Gets the ContractOptions in the context of the current template.

GetContractOptions(IDeclaration)

Gets the ContractOptions for a given declaration.

GetContractOptions(IFieldOrPropertyOrIndexer)

Gets the ContractOptions for a given field, property, or indexer.

GetContractOptions(IMethod)

Gets the ContractOptions for a given method.

GetContractOptions(INamedType)

Gets the ContractOptions for a given type.

GetContractOptions(IParameter)

Gets the ContractOptions for a given parameter.

VerifyNotNullableDeclarations(IAspectReceiver<ICompilation>, Boolean)

Add the NotNullAttribute aspect to all public, reference typed, non-nullable fields, properties and parameters in the compilation. The includeInternalApis parameter allows to enlarge the set to internal and private APIs.

VerifyNotNullableDeclarations(IAspectReceiver<INamedType>, Boolean)

Add the NotNullAttribute aspect to all public, reference typed, non-nullable fields, properties and parameters in the given types. The includeInternalApis parameter allows to enlarge the set to internal and private APIs.

VerifyNotNullableDeclarations(IAspectReceiver<INamespace>, Boolean)

Add the NotNullAttribute aspect to all public, reference typed, non-nullable fields, properties and parameters in the given namespaces. The includeInternalApis parameter allows to enlarge the set to internal and private APIs.