-
Notifications
You must be signed in to change notification settings - Fork 129
/
WritePrecision.java
77 lines (60 loc) · 1.75 KB
/
WritePrecision.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* InfluxDB OSS API Service
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.influxdb.client.domain;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Gets or Sets WritePrecision
*/
@JsonAdapter(WritePrecision.Adapter.class)
public enum WritePrecision {
MS("ms"),
S("s"),
US("us"),
NS("ns");
private String value;
WritePrecision(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static WritePrecision fromValue(String text) {
for (WritePrecision b : WritePrecision.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<WritePrecision> {
@Override
public void write(final JsonWriter jsonWriter, final WritePrecision enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public WritePrecision read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return WritePrecision.fromValue(String.valueOf(value));
}
}
}