UserWise Unity SDK  3.0.0
Public Member Functions | Public Attributes | Properties | Events | List of all members
UserWiseSDK.Variables.Types.Variable< T > Class Template Referenceabstract

Abstract Variable class that the various variable types implement More...

Inheritance diagram for UserWiseSDK.Variables.Types.Variable< T >:
UserWiseSDK.Variables.Types.IVariable

Public Member Functions

abstract void UpdateValueFromAPI (object newValue)
 Attempts to update the CurrentValue with the provided, abstract, newValue through proper type conversion. More...
 
virtual string GetName ()
 Getter access for the Name field. More...
 
virtual object GetDefaultValue ()
 Getter access for a formatted variant of the DefaultValue. Overridden in some variable types. More...
 
virtual object GetValueForCache ()
 Overridable method used for retrieving the CurrentValue as a cacheable value. More...
 
virtual void SetValueFromCache (object newValue)
 Acts as an overridable path for variable types that need to do different things during the set value from cache, that would not happen in UpdateValueFromAPI(object). More...
 
virtual void ResetToDefault ()
 Results the CurrentValue to the DefaultValue More...
 
GetCurrentOrDefaultValue ()
 Returns the CurrentValue, if present, otherwise returns the DefaultValue. More...
 
void SetCurrentValue (T newValue)
 Sets the CurrentValue to the provided newValue. Also emits the OnValueChange event. More...
 
string GetLowercaseVariableType ()
 Retrieves the Type (VariableType enum value) as a lowercase format string that the API-layer can ingest. More...
 

Public Attributes

readonly string Name
 
readonly T DefaultValue
 

Properties

CurrentValue [get, protected set]
 The current value of the Variable; in abstract typing. CurrentValue can be null, if there is no override. Generally, accessing the underlying value is done through GetCurrentOrDefaultValue(). More...
 

Events

EventHandler< OnValueChangeEventArgsOnValueChange
 

Detailed Description

Abstract Variable class that the various variable types implement

Member Function Documentation

◆ GetCurrentOrDefaultValue()

T UserWiseSDK.Variables.Types.Variable< T >.GetCurrentOrDefaultValue ( )
inline

Returns the CurrentValue, if present, otherwise returns the DefaultValue.

Returns
CurrentValue or DefaultValue

◆ GetDefaultValue()

virtual object UserWiseSDK.Variables.Types.Variable< T >.GetDefaultValue ( )
inlinevirtual

Getter access for a formatted variant of the DefaultValue. Overridden in some variable types.

Implements UserWiseSDK.Variables.Types.IVariable.

Reimplemented in UserWiseSDK.Variables.Types.DateTimeVariable.

◆ GetLowercaseVariableType()

string UserWiseSDK.Variables.Types.Variable< T >.GetLowercaseVariableType ( )
inline

Retrieves the Type (VariableType enum value) as a lowercase format string that the API-layer can ingest.

Implements UserWiseSDK.Variables.Types.IVariable.

◆ GetName()

virtual string UserWiseSDK.Variables.Types.Variable< T >.GetName ( )
inlinevirtual

Getter access for the Name field.

Implements UserWiseSDK.Variables.Types.IVariable.

◆ GetValueForCache()

virtual object UserWiseSDK.Variables.Types.Variable< T >.GetValueForCache ( )
inlinevirtual

Overridable method used for retrieving the CurrentValue as a cacheable value.

Returns

Implements UserWiseSDK.Variables.Types.IVariable.

Reimplemented in UserWiseSDK.Variables.Types.DateTimeVariable.

◆ ResetToDefault()

virtual void UserWiseSDK.Variables.Types.Variable< T >.ResetToDefault ( )
inlinevirtual

Results the CurrentValue to the DefaultValue

Implements UserWiseSDK.Variables.Types.IVariable.

◆ SetCurrentValue()

void UserWiseSDK.Variables.Types.Variable< T >.SetCurrentValue ( newValue)
inline

Sets the CurrentValue to the provided newValue. Also emits the OnValueChange event.

◆ SetValueFromCache()

virtual void UserWiseSDK.Variables.Types.Variable< T >.SetValueFromCache ( object  newValue)
inlinevirtual

Acts as an overridable path for variable types that need to do different things during the set value from cache, that would not happen in UpdateValueFromAPI(object).

Implements UserWiseSDK.Variables.Types.IVariable.

◆ UpdateValueFromAPI()

abstract void UserWiseSDK.Variables.Types.Variable< T >.UpdateValueFromAPI ( object  newValue)
pure virtual

Property Documentation

◆ CurrentValue

T UserWiseSDK.Variables.Types.Variable< T >.CurrentValue
getprotected set

The current value of the Variable; in abstract typing. CurrentValue can be null, if there is no override. Generally, accessing the underlying value is done through GetCurrentOrDefaultValue().


The documentation for this class was generated from the following file: