All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.xinyangpan.crypto4j.binance.dto.websocket.common.BaseDto Maven / Gradle / Ivy

There is a newer version: 0.1.4
Show newest version
package io.github.xinyangpan.crypto4j.binance.dto.websocket.common;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

@Data
public class BaseDto {

	@JsonProperty("e")
	protected String eventType;
	@JsonProperty("E")
	protected long eventTime;

	public String getEventTimeText() {
		LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(eventTime), ZoneId.systemDefault());
		return DateTimeFormatter.ISO_DATE_TIME.format(localDateTime);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy