-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
529 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
fpnn-lib/src/main/java/com/fpnn/callback/CallbackData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.fpnn.callback; | ||
|
||
import com.fpnn.FPData; | ||
|
||
import java.util.Map; | ||
|
||
public class CallbackData { | ||
|
||
private FPData _data = null; | ||
|
||
public FPData getData() { | ||
|
||
return this._data; | ||
} | ||
|
||
public CallbackData(FPData data) { | ||
|
||
this._data = data; | ||
} | ||
|
||
|
||
private Exception _exception = null; | ||
|
||
public Exception getException() { | ||
|
||
return this._exception; | ||
} | ||
|
||
public CallbackData(Exception ex) { | ||
|
||
this._exception = ex; | ||
} | ||
|
||
|
||
private Object _payload = null; | ||
|
||
public Object getPayload() { | ||
|
||
return this._payload; | ||
} | ||
|
||
public CallbackData(Object payload) { | ||
|
||
this._payload = payload; | ||
} | ||
|
||
|
||
public void checkException(Map data) { | ||
|
||
if (this._exception == null) { | ||
|
||
if (data == null) { | ||
|
||
this._exception = new Exception("data is null!"); | ||
} else if (data.containsKey("code") && data.containsKey("ex")) { | ||
|
||
this._exception = new Exception("code: ".concat(data.get("code").toString()).concat(", ex: ").concat(data.get("ex").toString())); | ||
} | ||
} | ||
|
||
if (this._exception == null) { | ||
|
||
this._payload = data; | ||
} | ||
|
||
this._data = null; | ||
} | ||
} |
Oops, something went wrong.