summaryrefslogtreecommitdiff
path: root/src/com/google/wireless/gdata/ConflictDetectedException.java
blob: efd918e58544a30df3b101d1587fc6651c9a8487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
  }
}