Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #14: add purge operation to CouchDbConnector
- Loading branch information
Henrik Lundgren
committed
Jul 8, 2011
1 parent
d26f76b
commit e63bf82
Showing
4 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.ektorp; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.codehaus.jackson.annotate.JsonAnyGetter; | ||
import org.codehaus.jackson.annotate.JsonAnySetter; | ||
import org.codehaus.jackson.annotate.JsonCreator; | ||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
public class PurgeResult { | ||
|
||
private final Map<String, List<String>> purged; | ||
private final long purgeSeq; | ||
|
||
@JsonCreator | ||
public PurgeResult(@JsonProperty("purged") Map<String, | ||
List<String>> purged,@JsonProperty("purge_seq") long purgeSeq) { | ||
this.purged = purged; | ||
this.purgeSeq = purgeSeq; | ||
} | ||
|
||
public Map<String, List<String>> getPurged() { | ||
return purged; | ||
} | ||
|
||
public long getPurgeSeq() { | ||
return purgeSeq; | ||
} | ||
|
||
private Map<String, Object> anonymous; | ||
|
||
/** | ||
* @return a Map containing fields that did not map to any other field in the class during object deserializarion from a JSON document. | ||
*/ | ||
@JsonAnyGetter | ||
public Map<String, Object> getAnonymous() { | ||
return anonymous(); | ||
} | ||
|
||
/** | ||
* Exists in order to future proof this class. | ||
* @param key | ||
* @param value | ||
*/ | ||
@JsonAnySetter | ||
public void setAnonymous(String key, Object value) { | ||
anonymous().put(key, value); | ||
} | ||
|
||
private Map<String, Object> anonymous() { | ||
if (anonymous == null) { | ||
anonymous = new HashMap<String, Object>(); | ||
} | ||
return anonymous; | ||
} | ||
} |
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