Package com.chemaxon.descriptors.common
Class Guarded.EnsureThat
java.lang.Object
com.chemaxon.descriptors.common.Guarded.EnsureThat
- Enclosing interface:
Guarded
Guarded checking utility.
Please note that this class is marked with Beta annotation, so it can be subject of incompatible
changes or removal in later releases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcompatible(Guarded base, String name, Guarded named) Ensure the guard object based compatibility of two objects.static voidcompatibleWithGuard(Object bg, String name, Guarded named) Ensure the guard object based compatibility of two objects.static voidEnsure that guarded context is valid.static voidvalidGuardObject(String name, Object guardObject) Ensure that guard object is valid.
-
Constructor Details
-
EnsureThat
public EnsureThat()
-
-
Method Details
-
compatibleWithGuard
Ensure the guard object based compatibility of two objects.This method should be called when guard object based compatibility criteria can be checked.
- Parameters:
bg- Base guard objectname- Name of named objectnamed- Named object- Throws:
NullPointerException- when either parameter oor returned guard object isnullIllegalArgumentException- 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>)."
-
compatible
Ensure the guard object based compatibility of two objects.This method should be called when guard object based compatibility criteria can be checked.
- Parameters:
base- Base objectname- Name of named objectnamed- Named object- Throws:
NullPointerException- when either parameter oor returned guard object isnullIllegalArgumentException- 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>)."
-
valid
Ensure that guarded context is valid.Currently check that the checked object or its guard object is not
null. This method should be called when a guard object reference is delegated, typically in a constructor.- Parameters:
name- Name of the guarded entitychecked- Checked object
-
validGuardObject
Ensure that guard object is valid.Currently check tat guard object is not
null.- Parameters:
name- Guard object nameguardObject- Guard object reference
-