Skip to content

Commit

Permalink
Fix RB-43 added creationTime getters to entity and transformator
Browse files Browse the repository at this point in the history
  • Loading branch information
gavronek committed Jan 29, 2015
1 parent 2f365a8 commit 04a8839
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import jodd.vtor.constraint.*;

import java.util.Date;

/**
* @author Adam Gavronek <[email protected]>
* @since 6/11/2014
Expand All @@ -40,13 +42,14 @@ public class Comment extends EntityBase {
@Min(-1)
private final int creatorId;

private final Date creationTime;

public Comment(Builder builder) {
Id = builder.id;
this.message = builder.message;
this.creatorId = builder.userId;
this.requirementId = builder.requirementId;

this.creationTime = builder.creationTime;
}

public int getRequirementId() {
Expand All @@ -65,6 +68,10 @@ public int getCreatorId() {
return creatorId;
}

public Date getCreationTime() {
return creationTime;
}

public static Builder getBuilder(String message) {
return new Builder(message);
}
Expand All @@ -74,6 +81,7 @@ public static class Builder {
private String message;
private int userId;
private int requirementId;
public Date creationTime;


public Builder(String message) {
Expand All @@ -95,6 +103,11 @@ public Builder creatorId(int creatorId) {
return this;
}

public Builder creationTime(Date creationTime) {
this.creationTime = creationTime;
return this;
}

public Comment build() {
return new Comment(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Comment mapToEntity(CommentsRecord record) {
.id(record.getId())
.requirementId(record.getRequirementId())
.creatorId(record.getUserId())
.creationTime(record.getCreationTime())
.build();
}

Expand Down

0 comments on commit 04a8839

Please sign in to comment.