Preconditions


Object Hierarchy:

Object hierarchy for Preconditions

Description:

public class Preconditions : Object

Utility methods for precondition checks.

Methods in this class return Result values when a condition is violated. Use these checks for programmer errors (invalid arguments or illegal state), and propagate the failure contract to callers.

Example:

    var argOk = Preconditions.checkArgument (port > 0, "port must be positive");
if (argOk.isError ()) {
return;
}
var stateOk = Preconditions.checkState (is_initialized, "not initialized");
if (stateOk.isError ()) {
return;
}


Namespace: Vala.Lang
Package: Valacore

Content:

Static methods:

Creation methods:

Inherited Members:

All known members inherited from class GLib.Object