Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
add revision attribute to TextFlowTarget DTO
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jun 29, 2011
1 parent 3bce92b commit 6f0dd34
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@ public class TextFlowTarget implements Serializable, Extensible<TextFlowTargetEx
private String content;
private String description;
private ExtensionSet<TextFlowTargetExtension> extensions;
private Integer revision;
private Integer textFlowRevision;

public TextFlowTarget()
Expand Down Expand Up @@ -148,6 +149,7 @@ public int hashCode()
result = prime * result + ((resId == null) ? 0 : resId.hashCode());
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((translator == null) ? 0 : translator.hashCode());
result = prime * result + ((revision == null) ? 0 : revision.hashCode());
result = prime * result + ((textFlowRevision == null) ? 0 : textFlowRevision.hashCode());
return result;
}
Expand Down Expand Up @@ -227,6 +229,17 @@ else if (!translator.equals(other.translator))
{
return false;
}
if (revision == null)
{
if (other.revision != null)
{
return false;
}
}
else if (!revision.equals(other.revision))
{
return false;
}
if (textFlowRevision == null)
{
if (other.textFlowRevision != null)
Expand All @@ -241,7 +254,17 @@ else if (!textFlowRevision.equals(other.textFlowRevision))
return true;
}

// TODO TFTs should probably have their own revisions too
@XmlAttribute(name = "revision", required = false)
public Integer getRevision()
{
return revision;
}

public void setRevision(Integer i)
{
revision = i;
}

@XmlAttribute(name = "resourceRevision", required = false)
public Integer getTextFlowRevision()
{
Expand Down
Expand Up @@ -810,6 +810,7 @@ public void transferToTextFlowTarget(HTextFlowTarget from, TextFlowTarget to)
{
to.setContent(from.getContent());
to.setState(from.getState());
to.setRevision(from.getVersionNum());
to.setTextFlowRevision(from.getTextFlowRevision());
HPerson translator = from.getLastModifiedBy();
if (translator != null)
Expand Down

0 comments on commit 6f0dd34

Please sign in to comment.