1 // Copyright 2009 The Android Open Source Project. 2 3 package com.google.wireless.gdata2; 4 5 import com.google.wireless.gdata2.data.Entry; 6 7 /** 8 * A ConflictDetectedException is thrown when the server detects a conflict 9 * between the Entry which the client is trying to insert or modify and an 10 * existing Entry. Typically this is because the version of the Entry being 11 * uploaded by the client is older than the version on the server, but it may 12 * also indicate the violation of some other constraint (e.g., key uniqueness). 13 */ 14 public class ConflictDetectedException extends GDataException { 15 16 private final Entry conflictingEntry; 17 18 /** 19 * Creates a new ConflictDetectedException with the given entry. 20 * @param conflictingEntry the conflicting entry state returned by the server. 21 */ ConflictDetectedException(Entry conflictingEntry)22 public ConflictDetectedException(Entry conflictingEntry) { 23 this.conflictingEntry = conflictingEntry; 24 } 25 26 /** 27 * @return the conflicting Entry returned by the server. 28 */ getConflictingEntry()29 public Entry getConflictingEntry() { 30 return conflictingEntry; 31 } 32 } 33