Skip to content

Commit e776220

Browse files
committed
refactor: rearrange fields
1 parent 4528543 commit e776220

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/spp/protocol/instrument/LiveMeter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import spp.protocol.instrument.throttle.InstrumentThrottle
2929
*/
3030
@DataObject
3131
data class LiveMeter(
32-
val meterDescription: String? = null,
3332
val meterType: MeterType,
3433
val metricValue: MetricValue,
34+
val meterDescription: String? = null,
3535
override val location: LiveSourceLocation,
3636
override val condition: String? = null,
3737
override val expiresAt: Long? = null,
@@ -46,9 +46,9 @@ data class LiveMeter(
4646
override val type: LiveInstrumentType = LiveInstrumentType.METER
4747

4848
constructor(json: JsonObject) : this(
49-
json.getString("meterDescription"),
5049
MeterType.valueOf(json.getString("meterType")),
5150
MetricValue(json.getJsonObject("metricValue")),
51+
json.getString("meterDescription"),
5252
LiveSourceLocation(json.getJsonObject("location")),
5353
json.getString("condition"),
5454
json.getLong("expiresAt"),
@@ -64,9 +64,9 @@ data class LiveMeter(
6464
override fun toJson(): JsonObject {
6565
val json = JsonObject()
6666
json.put("type", type.name)
67-
json.put("meterDescription", meterDescription)
6867
json.put("meterType", meterType.name)
6968
json.put("metricValue", metricValue.toJson())
69+
json.put("meterDescription", meterDescription)
7070
json.put("location", location.toJson())
7171
json.put("condition", condition)
7272
json.put("expiresAt", expiresAt)

0 commit comments

Comments
 (0)