@Beta @PublicAPI public static class Guarded.EnsureThat extends Object
Please note that this class is marked with Beta
annotation, so it can be subject of incompatible
changes or removal in later releases.
Constructor and Description |
---|
EnsureThat() |
Modifier and Type | Method and Description |
---|---|
static void |
compatible(Guarded base,
String name,
Guarded named)
Ensure the guard object based compatibility of two objects.
|
static void |
compatibleWithGuard(Object bg,
String name,
Guarded named)
Ensure the guard object based compatibility of two objects.
|
static void |
valid(String name,
Guarded checked)
Ensure that guarded context is valid.
|
static void |
validGuardObject(String name,
Object guardObject)
Ensure that guard object is valid.
|
public static void compatibleWithGuard(Object bg, String name, Guarded named)
bg
- Base guard objectname
- Name of named objectnamed
- Named objectNullPointerException
- when either parameter oor returned guard object is null
IllegalArgumentException
- in case of guard object mismatch. Message is in the form
"Guard object mismatch of <name>: Expected <base-guard-object> (0x<base-identity-hex>),
got <named-guard-object> (0x<named-identity-hex>).
"public static void compatible(Guarded base, String name, Guarded named)
base
- Base objectname
- Name of named objectnamed
- Named objectNullPointerException
- when either parameter oor returned guard object is null
IllegalArgumentException
- in case of guard object mismatch. Message is in the form
"Guard object mismatch of <name>: Expected <base-guard-object> (0x<base-identity-hex>),
got <named-guard-object> (0x<named-identity-hex>).
"public static void valid(String name, Guarded checked)
null
. This method should be
called when a guard object reference is delegated, typically in a constructor.name
- Name of the guarded entitychecked
- Checked object