Skip to content

Instantly share code, notes, and snippets.

@ldoguin
Last active August 29, 2015 14:14
Show Gist options
  • Save ldoguin/934d63c0d0f8d124c184 to your computer and use it in GitHub Desktop.
Save ldoguin/934d63c0d0f8d124c184 to your computer and use it in GitHub Desktop.
A twitter update Spring Document
package org.couchbase.advocacy.metrics.twitter;
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.Field;
@Document(expiry = 0)
public class TwitterUpdate {
@Id
@Field("id")
private String key;
@Field
private long createdAt;
@Field
private final String type = "twitterUpdate";
@Field
private String account;
@Field
private int followers;
@Field
private int favorites;
@Field
private int friends;
@Field
private int statuses;
public TwitterUpdate(String key, long createdAt, String account, int followers, int favorites, int friends, int statuses) {
this.key = key;
this.createdAt = createdAt;
this.account = account;
this.followers = followers;
this.favorites = favorites;
this.friends = friends;
this.statuses = statuses;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment