Package com.zopim.android.sdk.data
Class Path<T>
- java.lang.Object
-
- java.util.Observable
-
- com.zopim.android.sdk.data.Path<T>
-
- Direct Known Subclasses:
- ConnectionPath, LivechatAccountPath, LivechatAgentsPath, LivechatChatLogPath, LivechatDepartmentsPath, LivechatFileSendingPath, LivechatFormsPath, LivechatProfilePath
public abstract class Path<T> extends java.util.Observable
Definition of a data path in chat data source.Used in specific implementation of a data path representing a single source branch. Eg. connectivity state in
ConnectionPath
-
-
Constructor Summary
Constructors Constructor and Description Path()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description void
broadcast()
Will notify all observers that all data has changed on this data path.protected void
broadcast(T data)
Will notify all observers with the data passed as parameter.protected void
finalize()
abstract T
getData()
Gets the path data in it's current stateprotected boolean
isClearRequired(java.lang.String json)
Convenience method for interpreting json message update to the data path.void
notifyObservers(java.lang.Object object)
Deprecated.
-
-
-
Field Detail
-
DEBUG
protected static final boolean DEBUG
- See Also:
- Constant Field Values
-
data
protected T data
Local variable keeping the data reference
-
-
Method Detail
-
getData
public abstract T getData()
Gets the path data in it's current state- Returns:
- path data pojo object
-
isClearRequired
protected boolean isClearRequired(java.lang.String json)
Convenience method for interpreting json message update to the data path.It's per protocol definition that data gets cleared if json update arrives as null or string literal 'null'
- Parameters:
json
- that gets interpreted- Returns:
- true if data should be cleared, false otherwise
- See Also:
WebWidgetListener.msg(String)
,com.zopim.android.sdk.data.WebWidgetListener#shouldOverrideUrlLoading(android.webkit.WebView, String)
-
notifyObservers
@Deprecated public final void notifyObservers(java.lang.Object object)
Deprecated.This method is discouraged, usebroadcast(T data)
to notify your observers.Parametrized object must be of specified generic type T, or broadcast will be aborted.
- Overrides:
notifyObservers
in classjava.util.Observable
- Parameters:
object
- update
-
broadcast
protected void broadcast(T data)
Will notify all observers with the data passed as parameter. If nobody is listening there will be no broadcast.It will also mark this observable as changed so that Observer receives the update.
- Parameters:
data
- to broadcast
-
broadcast
public void broadcast()
Will notify all observers that all data has changed on this data path.
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-