Usage
For additional information visit:
Final classes in JET
Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.
Constructor
new Object
Methods
-
(static) compareValues(obj1, obj2) : {boolean}
-
Compares 2 values using strict equality except for the case of
- Array [order matters]; will traverse through the arrays and compare oj.Object.compareValues(array[i], array2[i])
- Instances that support valueOf [i.e. Boolean, String, Number, Date, and etc] will be compared by usage of that function
Parameters:
Name Type Description obj1
any The first value to compare. obj2
any The second value to compare. Returns:
- Type
- boolean
-
(static) copyPropertiesForClass(targetClass, source) : {void}
-
Copies properties from the source object to the prototype of the target class Only properties 'owned' by the source object will be copied, i.e. the properties from the source object's prototype chain will not be included. To copy properties from another class with methods defined on the prototype, pass otherClass.prototype as the source.
Parameters:
Name Type Description targetClass
Object the function whose prototype will be used a copy target source
Object object whose properties will be copied Returns:
- Type
- void
-
(static) createCallback(obj, func) : {()=>any}
-
Binds the supplied callback function to an object
Parameters:
Name Type Argument Description obj
OjObject <not nullable>
object that will be available to the supplied callback function as 'this' func
OjObject <not nullable>
the original callback Returns:
a function that will be invoking the original callback with 'this' object assigned to obj
- Type
- ()=>any
-
(static) createSubclass(extendingClass, baseClass, typeName) : {void}
-
Creates a subclass of a baseClass
Parameters:
Name Type Argument Description extendingClass
Object The class to extend from the base class baseClass
Object class to make the superclass of extendingClass typeName
string <optional>
to use for new class. If not specified, the typeName will be extracted from the baseClass's function if possible Returns:
- Type
- void
-
(static) ensureClassInitialization(clazz) : {void}
-
Ensures that a class is initialized. Although class initialization occurs by default the first time that an instance of a class is created, classes that use static factory methods to create their instances may still need to ensure that their class has been initialized when the factory method is called.
Parameters:
Name Type Description clazz
Object The class to ensure initialization of Returns:
- Type
- void
-
(static) getTypeName : {string}
-
Returns the type name for this instance
Returns:
name of the Class
- Type
- string
-
(static) isEmpty : {boolean}
-
Returns:
- Type
- boolean
-
clone : {Object}
-
Returns a clone of this object. The default implementation is a shallow copy. Subclassers can override this method to implement a deep copy.
Returns:
a clone of this object
- Type
- Object
-
equals(object) : {boolean}
-
Indicates whether some other oj.Object is "equal to" this one. Method is equivalent to java ".equals()" method.
Parameters:
Name Type Description object
Object comparison target Returns:
true if if the comparison target is equal to this object, false otherwise
- Type
- boolean
-
getClass(otherInstance) : {Object}
-
Returns the class object for the instance
Parameters:
Name Type Argument Description otherInstance
Object <optional>
if specified, the instance whose type should be returned. Otherwise the type of this instance will be returned Returns:
the class object for the instance
- Type
- Object
-
getTypeName(clazz) : {string}
-
Returns the type name for a class derived from oj.Object
Parameters:
Name Type Description clazz
Object | null Class to get the name of Returns:
name of the Class
- Type
- string
-
Init : {void}
-
Initializes the instance. Subclasses of oj.Object must call their superclass' Init
Returns:
- Type
- void
-
toDebugString : {string}
-
Returns:
- Type
- string
-
toString : {string}
-
Returns:
- Type
- string