SnapshotsClient.DataOrConflict
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public T getData ()
Returns data if the result was successful. Should only be called if
isConflict()
returns false
.
public boolean isConflict ()
Returns true
if there is conflict, in which case
getConflict()
can be used to access the details. If this method returns
false
,
getData()
can be used to access the requested data.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSnapshotsClient.DataOrConflict\u003c/code\u003e represents the result of opening a snapshot or resolving a conflict.\u003c/p\u003e\n"],["\u003cp\u003eIf successful, \u003ccode\u003eisConflict()\u003c/code\u003e returns \u003ccode\u003efalse\u003c/code\u003e and \u003ccode\u003egetData()\u003c/code\u003e provides access to the snapshot.\u003c/p\u003e\n"],["\u003cp\u003eIf a conflict occurs, \u003ccode\u003eisConflict()\u003c/code\u003e returns \u003ccode\u003etrue\u003c/code\u003e and \u003ccode\u003egetConflict()\u003c/code\u003e provides details for resolution using \u003ccode\u003eSnapshotsClient.resolveConflict()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetData()\u003c/code\u003e should only be called if \u003ccode\u003eisConflict()\u003c/code\u003e returns \u003ccode\u003efalse\u003c/code\u003e, otherwise, it throws an \u003ccode\u003eIllegalStateException\u003c/code\u003e.\u003c/p\u003e\n"]]],["`SnapshotsClient.DataOrConflict` represents the result of opening a snapshot or resolving a conflict. `isConflict()` indicates if a conflict exists. If `false`, `getData()` retrieves the opened snapshot. If `true`, `getConflict()` provides conflict details, which must be resolved using `SnapshotsClient.resolveConflict`. Calling `getData()` when `isConflict()` is true will throw `IllegalStateException`. Inherited methods from the class `Object` like `clone()`, `equals()`, and `toString()` are also available.\n"],null,["# SnapshotsClient.DataOrConflict\n\npublic static final class **SnapshotsClient.DataOrConflict** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nRepresents the result of attempting to open a snapshot or resolve a conflict from a\nprevious attempt.\n\nIf the snapshot was successfully opened or the conflict successfully resolved,\n[isConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#isConflict()) will return `false` and [getData()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getData()) can be used to access the now-opened snapshot.\n\nIf the operation resulted in a conflict, [isConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#isConflict()) will return `true`, and the result of [getConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getConflict()) must be used with [SnapshotsClient.resolveConflict(String, Snapshot)](/android/reference/com/google/android/gms/games/SnapshotsClient#resolveConflict(java.lang.String,%20com.google.android.gms.games.snapshot.Snapshot)) to resolve the conflict. \n\n### Public Method Summary\n\n|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SnapshotsClient.SnapshotConflict](/android/reference/com/google/android/gms/games/SnapshotsClient.SnapshotConflict) | [getConflict](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getConflict())() |\n| T | [getData](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getData())() Returns data if the result was successful. |\n| boolean | [isConflict](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#isConflict())() Returns `true` if there is conflict, in which case [getConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getConflict()) can be used to access the details. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public [SnapshotsClient.SnapshotConflict](/android/reference/com/google/android/gms/games/SnapshotsClient.SnapshotConflict)\n**getConflict** ()\n\n#### public T **getData** ()\n\nReturns data if the result was successful. Should only be called if [isConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#isConflict()) returns `false`. \n\n##### Throws\n\n| [IllegalStateException](//developer.android.com/reference/java/lang/IllegalStateException.html) | if this method is called when #isConflict is `true` ([getConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getConflict()) should be used instead). |\n|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public boolean **isConflict** ()\n\nReturns `true` if there is conflict, in which case [getConflict()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getConflict()) can be used to access the details. If this method returns\n`false`, [getData()](/android/reference/com/google/android/gms/games/SnapshotsClient.DataOrConflict#getData()) can be used to access the requested data."]]