public class Contract extends NetObject
.NET documentation at https://learn.microsoft.com/dotnet/api/System.Diagnostics.Contracts.Contract
Powered by JCOBridge: more info at https://www.jcobridge.com
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
assemblyFullName
Fully assembly qualified name: System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
|
static java.lang.String |
assemblyShortName
Assembly name: System.Private.CoreLib
|
static java.lang.String |
className
Qualified class name: System.Diagnostics.Contracts.Contract
|
static JCType |
classType
The type managed from JCOBridge.
|
| Constructor and Description |
|---|
Contract() |
Contract(java.lang.Object instance)
Internal constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
Assert(boolean condition)
Invokes the .NET member Assert.
|
static void |
Assert(boolean condition,
java.lang.String userMessage)
Invokes the .NET member Assert.
|
static void |
Assume(boolean condition)
Invokes the .NET member Assume.
|
static void |
Assume(boolean condition,
java.lang.String userMessage)
Invokes the .NET member Assume.
|
static Contract |
cast(IJCOBridgeReflected from)
Try to cast the
IJCOBridgeReflected instance into Contract, a cast assert is made to check if types are compatible. |
static void |
EndContractBlock()
Invokes the .NET member EndContractBlock.
|
static void |
Ensures(boolean condition)
Invokes the .NET member Ensures.
|
static void |
Ensures(boolean condition,
java.lang.String userMessage)
Invokes the .NET member Ensures.
|
static <TException extends IJCOBridgeReflected> |
EnsuresOnThrow(boolean condition)
Invokes the .NET member EnsuresOnThrow.
|
static <TException extends IJCOBridgeReflected> |
EnsuresOnThrow(boolean condition,
java.lang.String userMessage)
Invokes the .NET member EnsuresOnThrow.
|
static <T extends IJCOBridgeReflected> |
Exists(IEnumerable_1 collection,
Predicate_1 predicate)
Invokes the .NET member Exists.
|
static boolean |
Exists(int fromInclusive,
int toExclusive,
Predicate_1 predicate)
Invokes the .NET member Exists.
|
static <T extends IJCOBridgeReflected> |
ForAll(IEnumerable_1 collection,
Predicate_1 predicate)
Invokes the .NET member ForAll.
|
static boolean |
ForAll(int fromInclusive,
int toExclusive,
Predicate_1 predicate)
Invokes the .NET member ForAll.
|
java.lang.String |
getJCOAssemblyName()
Returns the full name of the assembly of the .NET type.
|
java.lang.String |
getJCOClassName()
Returns the full name of the .NET type.
|
java.lang.Object |
getJCOInstance()
Returns the underlying object managed by the bridge.
|
java.lang.String |
getJCOObjectName()
Returns the name of the .NET type qualified with its assembly.
|
JCType |
getJCOType()
Returns the
JCType of the .NET type. |
static void |
Invariant(boolean condition)
Invokes the .NET member Invariant.
|
static void |
Invariant(boolean condition,
java.lang.String userMessage)
Invokes the .NET member Invariant.
|
static void |
Requires(boolean condition)
Invokes the .NET member Requires.
|
static void |
Requires(boolean condition,
java.lang.String userMessage)
Invokes the .NET member Requires.
|
void |
setJCOInstance(JCObject instance)
Sets the underlying object managed by the bridge.
|
public static final java.lang.String assemblyFullName
public static final java.lang.String assemblyShortName
public static final java.lang.String className
public Contract()
throws java.lang.Throwable
java.lang.Throwablepublic Contract(java.lang.Object instance)
throws java.lang.Throwable
instance - the underlying bridge object: it must be a JCObjectjava.lang.Throwable - if instance is not a JCObjectpublic static void Assert(boolean condition)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
CultureNotFoundException,
ObjectDisposedException,
OutOfMemoryException,
ContractException,
IndexOutOfRangeException,
FormatException
condition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itContractException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itpublic static void Assert(boolean condition,
java.lang.String userMessage)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
CultureNotFoundException,
ObjectDisposedException,
OutOfMemoryException,
ContractException,
IndexOutOfRangeException,
FormatException
condition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itContractException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itpublic static void Assume(boolean condition)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
CultureNotFoundException,
ObjectDisposedException,
OutOfMemoryException,
ContractException,
IndexOutOfRangeException,
FormatException
condition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itContractException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itpublic static void Assume(boolean condition,
java.lang.String userMessage)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
CultureNotFoundException,
ObjectDisposedException,
OutOfMemoryException,
ContractException,
IndexOutOfRangeException,
FormatException
condition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itContractException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itpublic static Contract cast(IJCOBridgeReflected from) throws java.lang.Throwable
IJCOBridgeReflected instance into Contract, a cast assert is made to check if types are compatible.from - IJCOBridgeReflected instance to be castedContract instancejava.lang.Throwable - in case of error during cast operationpublic static void EndContractBlock()
throws java.lang.Throwable
java.lang.Throwable - if the call fails in the bridge or in the CLRpublic static void Ensures(boolean condition)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static void Ensures(boolean condition,
java.lang.String userMessage)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static <TException extends IJCOBridgeReflected> void EnsuresOnThrow(boolean condition) throws java.lang.Throwable, PlatformNotSupportedException, TypeLoadException, NotSupportedException, ArgumentException, MissingMethodException, TargetInvocationException, CultureNotFoundException, ContractException, OutOfMemoryException, InvalidOperationException, ArgumentOutOfRangeException, IndexOutOfRangeException, FormatException, ArgumentNullException
TException - the type of the generic argument TExceptioncondition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static <TException extends IJCOBridgeReflected> void EnsuresOnThrow(boolean condition, java.lang.String userMessage) throws java.lang.Throwable, PlatformNotSupportedException, TypeLoadException, NotSupportedException, ArgumentException, MissingMethodException, TargetInvocationException, CultureNotFoundException, ContractException, OutOfMemoryException, InvalidOperationException, ArgumentOutOfRangeException, IndexOutOfRangeException, FormatException, ArgumentNullException
TException - the type of the generic argument TExceptioncondition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static <T extends IJCOBridgeReflected> boolean Exists(IEnumerable_1 collection, Predicate_1 predicate) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
T - the type of the generic argument Tcollection - the argument of type IEnumerable_1predicate - the argument of type Predicate_1java.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itNotSupportedException - if the .NET member raises itObjectDisposedException - if the .NET member raises itInvalidOperationException - if the .NET member raises itRankException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static boolean Exists(int fromInclusive,
int toExclusive,
Predicate_1 predicate)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
IndexOutOfRangeException,
RankException,
CultureNotFoundException,
ObjectDisposedException
fromInclusive - the argument of type inttoExclusive - the argument of type intpredicate - the argument of type Predicate_1java.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itRankException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itpublic static <T extends IJCOBridgeReflected> boolean ForAll(IEnumerable_1 collection, Predicate_1 predicate) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException
T - the type of the generic argument Tcollection - the argument of type IEnumerable_1predicate - the argument of type Predicate_1java.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itNotSupportedException - if the .NET member raises itObjectDisposedException - if the .NET member raises itInvalidOperationException - if the .NET member raises itRankException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static boolean ForAll(int fromInclusive,
int toExclusive,
Predicate_1 predicate)
throws java.lang.Throwable,
ArgumentException,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
PlatformNotSupportedException,
ArrayTypeMismatchException,
NotSupportedException,
IndexOutOfRangeException,
RankException,
CultureNotFoundException,
ObjectDisposedException
fromInclusive - the argument of type inttoExclusive - the argument of type intpredicate - the argument of type Predicate_1java.lang.Throwable - if the call fails in the bridge or in the CLRArgumentException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itArgumentNullException - if the .NET member raises itInvalidOperationException - if the .NET member raises itPlatformNotSupportedException - if the .NET member raises itArrayTypeMismatchException - if the .NET member raises itNotSupportedException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itRankException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itObjectDisposedException - if the .NET member raises itpublic java.lang.String getJCOAssemblyName()
NetObjectgetJCOAssemblyName in interface IJCOBridgeReflectedgetJCOAssemblyName in class NetObjectpublic java.lang.String getJCOClassName()
NetObjectgetJCOClassName in interface IJCOBridgeReflectedgetJCOClassName in class NetObjectpublic java.lang.Object getJCOInstance()
NetObjectgetJCOInstance in interface IJCOBridgeReflectedgetJCOInstance in class NetObjectnull if there is nonepublic java.lang.String getJCOObjectName()
NetObjectgetJCOObjectName in interface IJCOBridgeReflectedgetJCOObjectName in class NetObjectpublic JCType getJCOType()
NetObjectJCType of the .NET type.getJCOType in interface IJCOBridgeReflectedgetJCOType in class NetObjectpublic static void Invariant(boolean condition)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static void Invariant(boolean condition,
java.lang.String userMessage)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static void Requires(boolean condition)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic static void Requires(boolean condition,
java.lang.String userMessage)
throws java.lang.Throwable,
PlatformNotSupportedException,
TypeLoadException,
NotSupportedException,
ArgumentException,
MissingMethodException,
TargetInvocationException,
CultureNotFoundException,
ContractException,
OutOfMemoryException,
InvalidOperationException,
ArgumentOutOfRangeException,
IndexOutOfRangeException,
FormatException,
ArgumentNullException
condition - the argument of type booleanuserMessage - the argument of type java.lang.Stringjava.lang.Throwable - if the call fails in the bridge or in the CLRPlatformNotSupportedException - if the .NET member raises itTypeLoadException - if the .NET member raises itNotSupportedException - if the .NET member raises itArgumentException - if the .NET member raises itMissingMethodException - if the .NET member raises itTargetInvocationException - if the .NET member raises itCultureNotFoundException - if the .NET member raises itContractException - if the .NET member raises itOutOfMemoryException - if the .NET member raises itInvalidOperationException - if the .NET member raises itArgumentOutOfRangeException - if the .NET member raises itIndexOutOfRangeException - if the .NET member raises itFormatException - if the .NET member raises itArgumentNullException - if the .NET member raises itpublic void setJCOInstance(JCObject instance)
NetObjectsetJCOInstance in class NetObjectinstance - the new underlying object