Skip to content

Commit 74060dc

Browse files
vbellottoraupachz
authored andcommitted
Adding customData to CommitEvent.Record (aws#79)
1 parent c534673 commit 74060dc

File tree

1 file changed

+30
-0
lines changed
  • aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events

1 file changed

+30
-0
lines changed

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CodeCommitEvent.java

+30
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ public static class Record implements Serializable, Cloneable {
290290

291291
private String awsRegion;
292292

293+
private String customData;
294+
293295
private Integer eventTotalParts;
294296

295297
/**
@@ -596,6 +598,27 @@ public Record withEventTotalParts(Integer eventTotalParts) {
596598
return this;
597599
}
598600

601+
/**
602+
*
603+
* @return custom data
604+
*/
605+
public String getCustomData(){ return this.customData;}
606+
607+
/**
608+
*
609+
* @param customData event custom data
610+
*/
611+
public void setCustomData(String customData) { this.customData = customData;}
612+
613+
/**
614+
* @param customData event
615+
* @return Record
616+
*/
617+
public Record withCustomData(String customData) {
618+
setCustomData(customData);
619+
return this;
620+
}
621+
599622
/**
600623
* Returns a string representation of this object; useful for testing and debugging.
601624
*
@@ -631,6 +654,8 @@ public String toString() {
631654
sb.append("eventSource: ").append(getEventSource()).append(",");
632655
if (getAwsRegion() != null)
633656
sb.append("awsRegion: ").append(getAwsRegion()).append(",");
657+
if (getCustomData() != null)
658+
sb.append("customData: ").append(getCustomData()).append(",");
634659
if (getEventTotalParts() != null)
635660
sb.append("eventTotalParts: ").append(getEventTotalParts());
636661
sb.append("}");
@@ -699,6 +724,10 @@ public boolean equals(Object obj) {
699724
return false;
700725
if (other.getEventTotalParts() != null && other.getEventTotalParts().equals(this.getEventTotalParts()) == false)
701726
return false;
727+
if (other.getCustomData() == null ^ this.getCustomData() == null)
728+
return false;
729+
if (other.getCustomData() != null && other.getCustomData().equals(this.getCustomData()) == false)
730+
return false;
702731
return true;
703732
}
704733

@@ -720,6 +749,7 @@ public int hashCode() {
720749
hashCode = prime * hashCode + ((getEventSource() == null) ? 0 : getEventSource().hashCode());
721750
hashCode = prime * hashCode + ((getAwsRegion() == null) ? 0 : getAwsRegion().hashCode());
722751
hashCode = prime * hashCode + ((getEventTotalParts() == null) ? 0 : getEventTotalParts().hashCode());
752+
hashCode = prime * hashCode + ((getCustomData() == null) ? 0 : getCustomData().hashCode());
723753
return hashCode;
724754
}
725755

0 commit comments

Comments
 (0)