<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>AndOperator - awaken the monster in you; javascript library by schukai GmbH</title> <meta name="description" content="javascript library for optimal use on fast and flexible pages." /> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> <script src="scripts/nav.js" defer></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav > <input type="text" id="nav-search" placeholder="Search" /> <h2><a href="index.html">Home</a></h2><h2><a href="https://www.schukai.com/" target="_blank" class="menu-item" id="schukai_link" >schukai GmbH</a></h2><h2><a href="https://www.npmjs.com/package/@schukai/monster" target="_blank" class="menu-item" id="npm_link" >NPM</a></h2><h3>Namespaces</h3><ul><li><a href="global.html#Monster">Monster</a><ul class='methods'><li data-type='method' style='display: none;'><a href="global.html#Monster#.assignToNamespace">assignToNamespace</a></li><li data-type='method' style='display: none;'><a href="global.html#Monster#.getVersion">getVersion</a></li></ul></li><li><a href="Monster_Constraints.html">Monster/Constraints</a></li><li><a href="Monster_Data.html">Monster/Data</a></li><li><a href="Monster_Logging.html">Monster/Logging</a></li><li><a href="Monster_Logging_Handler.html">Monster/Logging/Handler</a></li><li><a href="Monster_Math.html">Monster/Math</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Math.html#.random">random</a></li></ul></li><li><a href="Monster_Types.html">Monster/Types</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isArray">isArray</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isBoolean">isBoolean</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isFunction">isFunction</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isInstance">isInstance</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isInteger">isInteger</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isIterable">isIterable</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isObject">isObject</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isPrimitive">isPrimitive</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.isString">isString</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateArray">validateArray</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateBoolean">validateBoolean</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateFunction">validateFunction</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateInstance">validateInstance</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateInteger">validateInteger</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateIterable">validateIterable</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateObject">validateObject</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validatePrimitive">validatePrimitive</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.html#.validateString">validateString</a></li></ul></li><li><a href="Monster_Util.html">Monster/Util</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Util.html#.clone">clone</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.html#.deepFreeze">deepFreeze</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="Monster.Namespace.html">Namespace</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster.Namespace.html#getNamespace">getNamespace</a></li><li data-type='method' style='display: none;'><a href="Monster.Namespace.html#toString">toString</a></li></ul></li><li><a href="Monster_Constraints.AbstractConstraint.html">AbstractConstraint</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.AbstractConstraint.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.AbstractOperator.html">AbstractOperator</a></li><li><a href="Monster_Constraints.AndOperator.html">AndOperator</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.AndOperator.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.Invalid.html">Invalid</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.Invalid.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.IsArray.html">IsArray</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.IsArray.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.IsObject.html">IsObject</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.IsObject.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.OrOperator.html">OrOperator</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.OrOperator.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Constraints.Valid.html">Valid</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Constraints.Valid.html#isValid">isValid</a></li></ul></li><li><a href="Monster_Data.Pathfinder.html">Pathfinder</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Data.Pathfinder.html#exists">exists</a></li><li data-type='method' style='display: none;'><a href="Monster_Data.Pathfinder.html#getVia">getVia</a></li><li data-type='method' style='display: none;'><a href="Monster_Data.Pathfinder.html#setVia">setVia</a></li></ul></li><li><a href="Monster_Data.Pipe.html">Pipe</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Data.Pipe.html#run">run</a></li></ul></li><li><a href="Monster_Data.Transformer.html">Transformer</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Data.Transformer.html#run">run</a></li><li data-type='method' style='display: none;'><a href="Monster_Data.Transformer.html#setCallback">setCallback</a></li></ul></li><li><a href="Monster_Logging.Handler.html">Handler</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#getLogLevel">getLogLevel</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#log">log</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setAll">setAll</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setDebug">setDebug</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setError">setError</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setFatal">setFatal</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setInfo">setInfo</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setLogLevel">setLogLevel</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setOff">setOff</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setTrace">setTrace</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Handler.html#setWarn">setWarn</a></li></ul></li><li><a href="Monster_Logging.LogEntry.html">LogEntry</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Logging.LogEntry.html#getArguments">getArguments</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.LogEntry.html#getLogLevel">getLogLevel</a></li></ul></li><li><a href="Monster_Logging.Logger.html">Logger</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#addHandler">addHandler</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#getLabel">getLabel</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#getLevel">getLevel</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logDebug">logDebug</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logError">logError</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logFatal">logFatal</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logInfo">logInfo</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logTrace">logTrace</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#logWarn">logWarn</a></li><li data-type='method' style='display: none;'><a href="Monster_Logging.Logger.html#removeHandler">removeHandler</a></li></ul></li><li><a href="Monster_Logging_Handler.ConsoleHandler.html">ConsoleHandler</a></li><li><a href="Monster_Types.Base.html">Base</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.Base.html#toString">toString</a></li></ul></li><li><a href="Monster_Types.ID.html">ID</a></li><li><a href="Monster_Types.Observer.html">Observer</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.Observer.html#addTag">addTag</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Observer.html#getTags">getTags</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Observer.html#hasTag">hasTag</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Observer.html#removeTag">removeTag</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Observer.html#update">update</a></li></ul></li><li><a href="Monster_Types.ObserverList.html">ObserverList</a></li><li><a href="Monster_Types.ProxyObserver.html">ProxyObserver</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#attachObserver">attachObserver</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#containsObserver">containsObserver</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#detachObserver">detachObserver</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#getRealSubject">getRealSubject</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#getSubject">getSubject</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.ProxyObserver.html#notifyObservers">notifyObservers</a></li></ul></li><li><a href="Monster_Types.Queue.html">Queue</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.Queue.html#add">add</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Queue.html#clear">clear</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Queue.html#isEmpty">isEmpty</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Queue.html#peek">peek</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Queue.html#poll">poll</a></li></ul></li><li><a href="Monster_Types.Stack.html">Stack</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.Stack.html#clear">clear</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Stack.html#isEmpty">isEmpty</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Stack.html#peek">peek</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Stack.html#pop">pop</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Stack.html#push">push</a></li></ul></li><li><a href="Monster_Types.TokenList.html">TokenList</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#add">add</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#clear">clear</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#contains">contains</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#entries">entries</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#forEach">forEach</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#getIterator">getIterator</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#remove">remove</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#replace">replace</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#Symbol.iterator">Symbol.iterator</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#toggle">toggle</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.TokenList.html#toString">toString</a></li></ul></li><li><a href="Monster_Types.UniqueQueue.html">UniqueQueue</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.UniqueQueue.html#add">add</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.UniqueQueue.html#clear">clear</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.UniqueQueue.html#poll">poll</a></li></ul></li><li><a href="Monster_Types.Version.html">Version</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Types.Version.html#compareTo">compareTo</a></li><li data-type='method' style='display: none;'><a href="Monster_Types.Version.html#toString">toString</a></li></ul></li><li><a href="Monster_Util.Comparator.html">Comparator</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#equal">equal</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#greaterThan">greaterThan</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#greaterThanOrEqual">greaterThanOrEqual</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#lessThan">lessThan</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#lessThanOrEqual">lessThanOrEqual</a></li><li data-type='method' style='display: none;'><a href="Monster_Util.Comparator.html#reverse">reverse</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#ALL">ALL</a></li><li><a href="global.html#convertToString">convertToString</a></li><li><a href="global.html#getValueViaPath">getValueViaPath</a></li><li><a href="global.html#setValueViaPath">setValueViaPath</a></li></ul> </nav> <div id="main"> <h1 class="page-title">AndOperator</h1> <section> <header> <h2> <span class="ancestors"><a href="Monster_Constraints.html">Monster/Constraints</a>.</span> AndOperator </h2> <div class="class-description usertext"><p>The AndOperator is used to link several contraints. The constraint is fulfilled if all constraints of the operators are fulfilled.</p> <pre class="prettyprint source"><code><script type="module"> import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/constraints/andoperator.js'; new Monster.Constraint.AndOperator(new Monster.Constraint.Valid(), new Monster.Constraint.Valid()).then(()=>console.log(true)).catch(()=>console.log(false)); </script> </code></pre> <p>Alternatively, you can also integrate this function individually.</p> <pre class="prettyprint source"><code><script type="module"> import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/constraint/valid.js'; import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/constraints/andoperator.js'; new AndOperator(new Valid(), new Valid()).then(()=>console.log(true)).catch(()=>console.log(false)); </script> </code></pre></div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="AndOperator"><span class="type-signature"></span>new AndOperator<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="constraints_andoperator.js.html">constraints/andoperator.js</a>, <a href="constraints_andoperator.js.html#line34">line 34</a> </li></ul></dd> <dt class="tag-since">Since:</dt> <dd class="tag-since"><ul class="dummy"><li>1.3.0</li></ul></dd> <dt class="tag-copyright">Copyright:</dt> <dd class="tag-copyright"><ul class="dummy"><li>schukai GmbH</li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="isValid"><span class="type-signature"></span>isValid<span class="signature">(value)</span><span class="type-signature"> → {Promise}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="constraints_andoperator.js.html">constraints/andoperator.js</a>, <a href="constraints_andoperator.js.html#line42">line 42</a> </li></ul></dd> </dl> <div class="description usertext"> <p>this method return a promise containing the result of the check.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Promise</span> </dd> </dl> </article> </section> </div> <br class="clear"> <footer> </footer> <script>prettyPrint();</script> <script src="scripts/polyfill.js"></script> <script src="scripts/linenumber.js"></script> <script src="scripts/search.js" defer></script> <script src="scripts/collapse.js" defer></script> </body> </html>