diff options
Diffstat (limited to 'src/com/google/wireless/gdata/ConflictDetectedException.java')
-rw-r--r-- | src/com/google/wireless/gdata/ConflictDetectedException.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/com/google/wireless/gdata/ConflictDetectedException.java b/src/com/google/wireless/gdata/ConflictDetectedException.java new file mode 100644 index 0000000..efd918e --- /dev/null +++ b/src/com/google/wireless/gdata/ConflictDetectedException.java @@ -0,0 +1,32 @@ +// Copyright 2007 The Android Open Source Project + +package com.google.wireless.gdata; + +import com.google.wireless.gdata.data.Entry; + +/** + * A ConflictDetectedException is thrown when the server detects a conflict + * between the Entry which the client is trying to insert or modify and an + * existing Entry. Typically this is because the version of the Entry being + * uploaded by the client is older than the version on the server, but it may + * also indicate the violation of some other constraint (e.g., key uniqueness). + */ +public class ConflictDetectedException extends GDataException { + + private final Entry conflictingEntry; + + /** + * Creates a new ConflictDetectedException with the given entry. + * @param conflictingEntry the conflicting entry state returned by the server. + */ + public ConflictDetectedException(Entry conflictingEntry) { + this.conflictingEntry = conflictingEntry; + } + + /** + * @return the conflicting Entry returned by the server. + */ + public Entry getConflictingEntry() { + return conflictingEntry; + } +} |