refactor: migrate JodaTime to java.time (rebuild on subdate2 ab96cfc)
Complete the JodaTime -> java.time migration across 30 files on the correct subdate2 base. No org.joda references remain.
This commit is contained in:
1 parent
ab96cfcda4
commit
8a136d84f4
30 files changed
+184
-196
No files matched your search
@@ -13,10 +13,11 @@ package engine.objects;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.GuildHistoryType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
|
||||
public class GuildHistory {
|
||||
@@ -24,12 +25,12 @@ public class GuildHistory {
|
||||
|
||||
private int guildID;
|
||||
private String guildName;
|
||||
private DateTime time;
|
||||
private Instant time;
|
||||
private GuildHistoryType historyType;
|
||||
|
||||
|
||||
public GuildHistory(int guildID, String guildName,
|
||||
DateTime dateTime, GuildHistoryType historyType) {
|
||||
Instant dateTime, GuildHistoryType historyType) {
|
||||
super();
|
||||
this.guildID = guildID;
|
||||
this.guildName = guildName;
|
||||
@@ -49,9 +50,9 @@ public class GuildHistory {
|
||||
|
||||
sqlDateTime = rs.getTimestamp("historyDate");
|
||||
if (sqlDateTime != null)
|
||||
this.time = new DateTime(sqlDateTime);
|
||||
this.time = sqlDateTime.toInstant();
|
||||
else
|
||||
this.time = DateTime.now().minusYears(1);
|
||||
this.time = Instant.now().minus(1, ChronoUnit.YEARS);
|
||||
this.historyType = GuildHistoryType.valueOf(rs.getString("historyType"));
|
||||
}
|
||||
|
||||
@@ -77,11 +78,11 @@ public class GuildHistory {
|
||||
writer.putDateTime(this.time);
|
||||
}
|
||||
|
||||
public DateTime getTime() {
|
||||
public Instant getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(DateTime time) {
|
||||
public void setTime(Instant time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user