How to use the java.instanceOf function in java

To help you get started, we’ve selected a few java examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inolen / gremlin-node / gremlin-node.js View on Github external
function _isType(o, typeName) {
    if (!o._isType) {
        o._isType = {};
    }
    var res = o._isType[typeName];
    if (res === undefined) {
        try {
            res = java.instanceOf(o, typeName);
        } catch(err) {
            res = false;
        }
        o._isType[typeName] = res;
    }
    return res;
}
github jsdevel / webdriver-sync / src / interfaces / JavascriptExecutor.js View on Github external
function coerce(result) {
  if (result === void 0 || result === null)
    return null;
  if (typeof result !== 'object')
    return result;
  if (java.instanceOf(result, classPaths.WebElement))
    return new WebElement(result);
  if (java.instanceOf(result, classPaths.Long))
    return result.longValue;
  if (java.instanceOf(result, classPaths.List)) {
    return toArray(result, coerce);
  }
  if (java.instanceOf(result, classPaths.Map)) {
    return toObject(result, coerce);
  }
  return result;
}
github jsdevel / webdriver-sync / src / interfaces / JavascriptExecutor.js View on Github external
function coerce(result) {
  if (result === void 0 || result === null)
    return null;
  if (typeof result !== 'object')
    return result;
  if (java.instanceOf(result, classPaths.WebElement))
    return new WebElement(result);
  if (java.instanceOf(result, classPaths.Long))
    return result.longValue;
  if (java.instanceOf(result, classPaths.List)) {
    return toArray(result, coerce);
  }
  if (java.instanceOf(result, classPaths.Map)) {
    return toObject(result, coerce);
  }
  return result;
}
github RedSeal-co / ts-tinkerpop / lib / tsJavaModule.js View on Github external
function instanceOf(javaObject, className) {
        var fullName = fullyQualifiedName(className) || className;
        return smellsLikeJavaObject(javaObject) && _java.instanceOf(javaObject, fullName);
    }
    Java.instanceOf = instanceOf;
github jsdevel / webdriver-sync / src / interfaces / JavascriptExecutor.js View on Github external
function coerce(result) {
  if (result === void 0 || result === null)
    return null;
  if (typeof result !== 'object')
    return result;
  if (java.instanceOf(result, classPaths.WebElement))
    return new WebElement(result);
  if (java.instanceOf(result, classPaths.Long))
    return result.longValue;
  if (java.instanceOf(result, classPaths.List)) {
    return toArray(result, coerce);
  }
  if (java.instanceOf(result, classPaths.Map)) {
    return toObject(result, coerce);
  }
  return result;
}
github DanielGarciaMandillo / angular-java / app / angularApp / tsJavaModule.js View on Github external
function isJavaObject(e) {
        return smellsLikeJavaObject(e) && _java.instanceOf(e, 'java.lang.Object');
    }
    Java.isJavaObject = isJavaObject;
github jsdevel / webdriver-sync / src / interfaces / JavascriptExecutor.js View on Github external
function coerce(result) {
  if (result === void 0 || result === null)
    return null;
  if (typeof result !== 'object')
    return result;
  if (java.instanceOf(result, classPaths.WebElement))
    return new WebElement(result);
  if (java.instanceOf(result, classPaths.Long))
    return result.longValue;
  if (java.instanceOf(result, classPaths.List)) {
    return toArray(result, coerce);
  }
  if (java.instanceOf(result, classPaths.Map)) {
    return toObject(result, coerce);
  }
  return result;
}
github DanielGarciaMandillo / angular-java / build / java / tsJavaModule.js View on Github external
function isJavaObject(e) {
        return smellsLikeJavaObject(e) && _java.instanceOf(e, 'java.lang.Object');
    }
    Java.isJavaObject = isJavaObject;
github DanielGarciaMandillo / angular-java / build / java / tsJavaModule.js View on Github external
function asInstanceOf(obj, className) {
        var fullName = fullyQualifiedName(className) || className;
        if (_java.instanceOf(obj, fullName)) {
            return obj;
        }
        else {
            throw new Error('asInstanceOf fails, obj is not a ' + fullName);
        }
    }
    Java.asInstanceOf = asInstanceOf;