Package | ardisia.utils |
Class | public class ObjectUtils |
Inheritance | ObjectUtils Object |
Completely static class, no need to create any instances.
Method | Defined By | ||
---|---|---|---|
arraysAreEqual(a:Array, b:Array):Boolean [static]
Tests whether two arrays are identical. | ObjectUtils | ||
clone(source:Object):* [static]
Copies an object as a ByteArray. | ObjectUtils | ||
generateSealedObjectString(item:Object, prefix:String = null):String [static]
Creates a string based on a sealed object's variables and properties
using flash reflection classes. | ObjectUtils |
arraysAreEqual | () | method |
public static function arraysAreEqual(a:Array, b:Array):Boolean
Tests whether two arrays are identical.
Note: if the arrays contain references to objects, this function tests for references to the same object, not the underlying data.
Parameters
a:Array | |
b:Array |
Boolean — a Boolean value if identical
|
clone | () | method |
public static function clone(source:Object):*
Copies an object as a ByteArray.
Note: the cloned object will not be typed.
Parameters
source:Object — the object to clone
|
* — the cloned object
|
generateSealedObjectString | () | method |
public static function generateSealedObjectString(item:Object, prefix:String = null):String
Creates a string based on a sealed object's variables and properties using flash reflection classes.
Function loops through an object's variables, properties, nested variables, and nested properties until it finds primitive values and appends the primitives to a string. This way the string represents the object's data values, and not simply references.
Useful to compare whether two objects share the same underlying data because if two objects have the same parsed string created via this function, then they have the same values and vice-versa.
Parameters
item:Object — the object to create a string for
| |
prefix:String (default = null ) — a prefix to append to the generated string
|
String — a string representing the objects data
|