Any class member imported.
We'll need to use 'any' as any is callable.
The actual type would be JavaType | ((...args: JavaType[]) => JavaType | Promise
Create a new java instance of type java_instance_proxy["class.proxy.instance"]
Rest
...args: BasicOrJavaType[]the arguments to create the instance
Static
Readonly
class.proxyThe class proxy class instance
Static
classGet the java class instance
Optional
[custom]Custom inspect method for an improved console.log output. This will return the output of toString. Will only be defined if JavaConfig.customInspect is true.
this as a string
2.4.0
Default java equals implementation. Async call.
the object to compare this to
true if this matches o
Default java equals implementation. Sync call.
the object to compare this to
true if this matches o
Check if this is an instance of another class. Pass either the name of the other class or the class itself to check if this is an instance of it. Does not overwrite any existing instanceof operator. This uses the native java instanceof operator.
This method's name is not affected by the JavaConfig#syncSuffix and JavaConfig#asyncSuffix options.
import { importClass } from 'java-bridge';
const JavaString = importClass('java.lang.String');
const str = new JavaString('Hello World');
str.instanceOf(JavaString); // true
str.instanceOf('java.lang.String'); // true
str.instanceOf('java.lang.Object'); // true
str.instanceOf('java.lang.Integer'); // false
the class to check if this is an instance of
true if this is instance of other
Java default toString method. Sync call.
This method's name is not affected by the JavaConfig#syncSuffix and JavaConfig#asyncSuffix options.
this as a string
Java default toString method. Async call.
This method's name is not affected by the JavaConfig#syncSuffix and JavaConfig#asyncSuffix options.
this as a string
2.4.0
Java default toString method. Sync call.
This method's name is not affected by the JavaConfig#syncSuffix and JavaConfig#asyncSuffix options.
this as a string
use toString instead
Static
newCreate a new java class instance. Async version.
This method's name is not affected by the JavaConfig#syncSuffix and JavaConfig#asyncSuffix options.
Rest
...args: BasicOrJavaType[]the arguments to create the instance
the java_instance_proxy instance
Rest
...args: BasicOrJavaType[]Generated using TypeDoc
The java instance proxy class. This class actually does all the magic. After it is created, this will just be a constructor with all static methods and properties (the accessible ones) stored in it and ready for use. Once the actual instance using the new operator is created, a new java_instance_proxy instance is created, containing the actual java instance (that thing isn't visible though) and all (visible) non-static class member methods and properties.