Skip to content

Remove Joda-Time dependency #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions aws-lambda-java-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@
</distributionManagement>

<dependencies>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.6</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.amazonaws.services.lambda.runtime.events;

import org.joda.time.DateTime;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.List;

/**
Expand Down Expand Up @@ -270,7 +269,7 @@ public static class Record implements Serializable, Cloneable {

private String eventVersion;

private DateTime eventTime;
private ZonedDateTime eventTime;

private String eventTriggerName;

Expand Down Expand Up @@ -348,22 +347,22 @@ public Record withEventVersion(String eventVersion) {
/**
* @return event timestamp
*/
public DateTime getEventTime() {
public ZonedDateTime getEventTime() {
return this.eventTime;
}

/**
* @param eventTime event timestamp
*/
public void setEventTime(DateTime eventTime) {
public void setEventTime(ZonedDateTime eventTime) {
this.eventTime = eventTime;
}

/**
* @param eventTime event timestamp
* @return Record
*/
public Record withEventTime(DateTime eventTime) {
public Record withEventTime(ZonedDateTime eventTime) {
setEventTime(eventTime);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
*/
package com.amazonaws.services.lambda.runtime.events;

import org.joda.time.DateTime;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -181,7 +180,7 @@ public static class SNS implements Serializable, Cloneable {

private String signature;

private DateTime timestamp;
private ZonedDateTime timestamp;

private String topicArn;

Expand Down Expand Up @@ -421,23 +420,23 @@ public SNS withSignature(String signature) {
* Gets the message time stamp
* @return timestamp of sns message
*/
public DateTime getTimestamp() {
public ZonedDateTime getTimestamp() {
return timestamp;
}

/**
* Sets the message time stamp
* @param timestamp A Date object representing the message time stamp
*/
public void setTimestamp(DateTime timestamp) {
public void setTimestamp(ZonedDateTime timestamp) {
this.timestamp = timestamp;
}

/**
* @param timestamp timestamp
* @return SNS
*/
public SNS withTimestamp(DateTime timestamp) {
public SNS withTimestamp(ZonedDateTime timestamp) {
setTimestamp(timestamp);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

package com.amazonaws.services.lambda.runtime.events;

import org.joda.time.DateTime;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;

Expand All @@ -38,7 +37,7 @@ public class ScheduledEvent implements Serializable, Cloneable {

private String id;

private DateTime time;
private ZonedDateTime time;

private List<String> resources;

Expand Down Expand Up @@ -69,7 +68,7 @@ public ScheduledEvent withAccount(String account) {
setAccount(account);
return this;
}

/**
* @return the aws region
*/
Expand All @@ -92,7 +91,7 @@ public ScheduledEvent withRegion(String region) {
setRegion(region);
return this;
}

/**
* @return The details of the events (usually left blank)
*/
Expand All @@ -115,7 +114,7 @@ public ScheduledEvent withDetail(Map<String, Object> detail) {
setDetail(detail);
return this;
}

/**
* @return The details type - see cloud watch events for more info
*/
Expand All @@ -138,7 +137,7 @@ public ScheduledEvent withDetailType(String detailType) {
setDetailType(detailType);
return this;
}

/**
* @return the soruce of the event
*/
Expand All @@ -161,30 +160,30 @@ public ScheduledEvent withSource(String source) {
setSource(source);
return this;
}

/**
* @return the timestamp for when the event is scheduled
*/
public DateTime getTime() {
public ZonedDateTime getTime() {
return this.time;
}

/**
* @param time the timestamp for when the event is scheduled
*/
public void setTime(DateTime time) {
public void setTime(ZonedDateTime time) {
this.time = time;
}

/**
* @param time the timestamp for when the event is scheduled
* @return ScheduledEvent
*/
public ScheduledEvent withTime(DateTime time) {
public ScheduledEvent withTime(ZonedDateTime time) {
setTime(time);
return this;
}

/**
* @return the id of the event
*/
Expand All @@ -207,7 +206,7 @@ public ScheduledEvent withId(String id) {
setId(id);
return this;
}

/**
* @return the resources used by event
*/
Expand Down Expand Up @@ -331,5 +330,5 @@ public ScheduledEvent clone() {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
*/
package com.amazonaws.services.lambda.runtime.events.models.s3;

import org.joda.time.DateTime;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.time.ZonedDateTime;
import java.util.List;

/**
Expand Down Expand Up @@ -244,7 +243,7 @@ public static class S3EventNotificationRecord {
private final String awsRegion;
private final String eventName;
private final String eventSource;
private DateTime eventTime;
private ZonedDateTime eventTime;
private final String eventVersion;
private final RequestParametersEntity requestParameters;
private final ResponseElementsEntity responseElements;
Expand All @@ -261,7 +260,7 @@ public S3EventNotificationRecord(String awsRegion, String eventName, String even

if (eventTime != null)
{
this.eventTime = DateTime.parse(eventTime);
this.eventTime = ZonedDateTime.parse(eventTime);
}

this.eventVersion = eventVersion;
Expand All @@ -283,7 +282,7 @@ public String getEventSource() {
return eventSource;
}

public DateTime getEventTime() {
public ZonedDateTime getEventTime() {
return eventTime;
}

Expand Down