-
Notifications
You must be signed in to change notification settings - Fork 205
/
Notifier.java
52 lines (42 loc) · 1.33 KB
/
Notifier.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.bugsnag.android;
import android.support.annotation.NonNull;
import java.io.IOException;
/**
* Information about this library, including name and version.
*/
public class Notifier implements JsonStream.Streamable {
static final String NOTIFIER_NAME = "Android Bugsnag Notifier";
static final String NOTIFIER_VERSION = "4.3.3";
static final String NOTIFIER_URL = "https://bugsnag.com";
private String name;
private String version;
private String url;
private static final Notifier instance = new Notifier();
@NonNull
public static Notifier getInstance() {
return instance;
}
Notifier() {
this.name = NOTIFIER_NAME;
this.version = NOTIFIER_VERSION;
this.url = NOTIFIER_URL;
}
@Override
public void toStream(@NonNull JsonStream writer) throws IOException {
writer.beginObject();
writer.name("name").value(name);
writer.name("version").value(version);
writer.name("url").value(url);
writer.endObject();
}
public void setVersion(@NonNull String version) {
this.version = version;
}
@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public void setURL(@NonNull String url) {
this.url = url;
}
public void setName(@NonNull String name) {
this.name = name;
}
}