Skip to content

Commit 4f3c20e

Browse files
committed
Make session_age a Double rather than a Float
1 parent 3c1925a commit 4f3c20e

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/main/java/com/maxmind/minfraud/request/Device.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public final class Device extends AbstractModel {
1212
private final InetAddress ipAddress;
1313
private final String userAgent;
1414
private final String acceptLanguage;
15-
private final Float sessionAge;
15+
private final Double sessionAge;
1616
private final String sessionId;
1717

1818
private Device(Device.Builder builder) {
@@ -31,7 +31,7 @@ public static final class Builder {
3131
InetAddress ipAddress;
3232
String userAgent;
3333
String acceptLanguage;
34-
Float sessionAge;
34+
Double sessionAge;
3535
String sessionId;
3636

3737
/**
@@ -69,14 +69,14 @@ public Device.Builder acceptLanguage(String acceptLanguage) {
6969
}
7070

7171
/**
72-
* @param sessionAge A floating point number. The number of seconds
73-
* between the creation of the user's session and
74-
* the time of the transaction. Note that session_age
75-
* is not the duration of the current visit, but
76-
* the time since the start of the first visit.
77-
* @return The builder object.
72+
* @param sessionAge The number of seconds between the creation of the
73+
* user's session and the time of the transaction.
74+
* Note that session_age is not the duration of the
75+
* current visit, but the time since the start of the
76+
* first visit.
77+
* @return The builder object.
7878
*/
79-
public Device.Builder sessionAge(Float sessionAge) { this.sessionAge =
79+
public Device.Builder sessionAge(Double sessionAge) { this.sessionAge =
8080
sessionAge; return this; }
8181

8282
/**
@@ -119,7 +119,7 @@ public String getAcceptLanguage() {
119119
* @return The session age.
120120
*/
121121
@JsonProperty("session_age")
122-
public Float getSessionAge() {
122+
public Double getSessionAge() {
123123
return sessionAge;
124124
}
125125

src/test/java/com/maxmind/minfraud/request/DeviceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testAcceptLanguage() throws Exception {
3939

4040
@Test
4141
public void testSessionAge() throws Exception {
42-
Float hour = (float) 3600;
42+
Double hour = 3600d;
4343
Device device = new Builder(ip).sessionAge(hour).build();
4444
assertEquals(hour, device.getSessionAge());
4545
}

0 commit comments

Comments
 (0)