API Docs for: 1.0.0
Show:

DynamicState Class

Utility Class to create Dynamic state objects with three properties: objectName, className, sessionState

Item Index

Properties

Methods

alterSessionStateToBypassDiff

(
  • state
)
Boolean static

Alters a session state object to bypass special diff logic for dynamic state arrays. It does so by adding the "bypassDiff" property to any part for which isDynamicState(part) returns true.

Parameters:

  • state Object

Returns:

Boolean:

A value of true if the Array looks like a dynamic session state or diff.

create

(
  • objectName
  • className
  • sessionState
)
static

Creates an Object having three properties: objectName, className, sessionState

Parameters:

  • objectName String

    The name assigned to the object when the session state is generated.

  • className String

    The qualified class name of the original object providing the session state.

  • sessionState Object

    The session state for an object of the type specified by className.

isDynamicState

(
  • object
)
Boolean static

This function can be used to detect dynamic state objects within nested, untyped session state objects. This function will check if the given object has the three properties of a dynamic state object.

Parameters:

  • object Object

    An object to check.

Returns:

Boolean:

true if the object has all three properties and no extras.

isDynamicStateArray

(
  • state
)
Boolean static

This function checks whether or not a session state is an Array containing at least one object that looks like a DynamicState and has no other non-String items.

Parameters:

  • state Object

Returns:

Boolean:

A value of true if the Array looks like a dynamic session state or diff.

Properties

BYPASS_DIFF

String public static

The name of the property used to make isDynamicState() return false in order to bypass special diff logic for dynamic state arrays.

Default: "bypassDiff"

CLASS_NAME

String public static

The name of the property containing the qualified class name of the original object providing the session state.

Default: "className"

OBJECT_NAME

String public static

The name of the property containing the name assigned to the object when the session state is generated.

Default: "objectName"

SESSION_STATE

String public static

The name of the property containing the session state for an object of the type specified by className.

Default: "sessionState"