mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1)
136749 jkaabimofrad: Minor re-formatting (replace tabs with spaces) noted via APPSREPO-147. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136756 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -49,127 +49,127 @@ import org.json.simple.JSONObject;
|
||||
*/
|
||||
public class FavouriteDocument extends FavouriteNode implements ExpectedComparison, JSONAble
|
||||
{
|
||||
private static final long serialVersionUID = -5890002728061039516L;
|
||||
private static final long serialVersionUID = -5890002728061039516L;
|
||||
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
|
||||
/**
|
||||
* For POSTs
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteDocument(String guid)
|
||||
{
|
||||
super(guid);
|
||||
}
|
||||
/**
|
||||
* For POSTs
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteDocument(String guid)
|
||||
{
|
||||
super(guid);
|
||||
}
|
||||
|
||||
public FavouriteDocument(String id, String guid)
|
||||
{
|
||||
super(id, guid);
|
||||
}
|
||||
public FavouriteDocument(String id, String guid)
|
||||
{
|
||||
super(id, guid);
|
||||
}
|
||||
|
||||
// public Document(String id, String guid, Map<String, Serializable> properties)
|
||||
// {
|
||||
// super(id, guid, properties);
|
||||
// }
|
||||
// public Document(String id, String guid, Map<String, Serializable> properties)
|
||||
// {
|
||||
// super(id, guid, properties);
|
||||
// }
|
||||
|
||||
public static FavouriteDocument getDocument(String id, String guid, Properties props)
|
||||
{
|
||||
FavouriteDocument document = new FavouriteDocument(id, guid);
|
||||
public static FavouriteDocument getDocument(String id, String guid, Properties props)
|
||||
{
|
||||
FavouriteDocument document = new FavouriteDocument(id, guid);
|
||||
|
||||
Map<String, PropertyData<?>> properties = props.getProperties();
|
||||
document.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
|
||||
document.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
|
||||
document.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
|
||||
document.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
|
||||
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
|
||||
document.setModifiedAt(modifiedAt.getTime());
|
||||
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
|
||||
document.setCreatedAt(createdAt.getTime());
|
||||
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
|
||||
document.setMimeType((String)properties.get(PropertyIds.CONTENT_STREAM_MIME_TYPE).getFirstValue());
|
||||
document.setSizeInBytes((BigInteger)properties.get(PropertyIds.CONTENT_STREAM_LENGTH).getFirstValue());
|
||||
document.setVersionLabel((String)properties.get(PropertyIds.VERSION_LABEL).getFirstValue());
|
||||
return document;
|
||||
}
|
||||
Map<String, PropertyData<?>> properties = props.getProperties();
|
||||
document.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
|
||||
document.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
|
||||
document.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
|
||||
document.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
|
||||
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
|
||||
document.setModifiedAt(modifiedAt.getTime());
|
||||
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
|
||||
document.setCreatedAt(createdAt.getTime());
|
||||
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
|
||||
document.setMimeType((String)properties.get(PropertyIds.CONTENT_STREAM_MIME_TYPE).getFirstValue());
|
||||
document.setSizeInBytes((BigInteger)properties.get(PropertyIds.CONTENT_STREAM_LENGTH).getFirstValue());
|
||||
document.setVersionLabel((String)properties.get(PropertyIds.VERSION_LABEL).getFirstValue());
|
||||
return document;
|
||||
}
|
||||
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
|
||||
public void setMimeType(String mimeType)
|
||||
{
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
|
||||
public void setSizeInBytes(BigInteger sizeInBytes)
|
||||
{
|
||||
this.sizeInBytes = sizeInBytes;
|
||||
}
|
||||
public void setMimeType(String mimeType)
|
||||
{
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public void setVersionLabel(String versionLabel)
|
||||
{
|
||||
this.versionLabel = versionLabel;
|
||||
}
|
||||
public void setSizeInBytes(BigInteger sizeInBytes)
|
||||
{
|
||||
this.sizeInBytes = sizeInBytes;
|
||||
}
|
||||
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = super.toJSON();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
super.expected(o);
|
||||
public void setVersionLabel(String versionLabel)
|
||||
{
|
||||
this.versionLabel = versionLabel;
|
||||
}
|
||||
|
||||
assertTrue(o instanceof FavouriteDocument);
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = super.toJSON();
|
||||
return json;
|
||||
}
|
||||
|
||||
FavouriteDocument other = (FavouriteDocument)o;
|
||||
|
||||
AssertUtil.assertEquals("mimeType", mimeType, other.getMimeType());
|
||||
AssertUtil.assertEquals("sizeInBytes", sizeInBytes, other.getSizeInBytes());
|
||||
AssertUtil.assertEquals("versionLabel", versionLabel, other.getVersionLabel());
|
||||
}
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
super.expected(o);
|
||||
|
||||
public static FavouriteDocument parseDocument(JSONObject jsonObject) throws ParseException
|
||||
{
|
||||
String id = (String)jsonObject.get("id");
|
||||
String guid = (String)jsonObject.get("guid");
|
||||
String name = (String)jsonObject.get("name");
|
||||
String title = (String)jsonObject.get("title");
|
||||
String description = (String)jsonObject.get("description");
|
||||
Date createdAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("createdAt"));
|
||||
Date modifiedAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("modifiedAt"));
|
||||
String createdBy = (String)jsonObject.get("createdBy");
|
||||
String modifiedBy = (String)jsonObject.get("modifiedBy");
|
||||
String mimeType = (String)jsonObject.get("mimeType");
|
||||
Long sizeInBytes = (Long)jsonObject.get("sizeInBytes");
|
||||
String versionLabel = (String)jsonObject.get("versionLabel");
|
||||
assertTrue(o instanceof FavouriteDocument);
|
||||
|
||||
FavouriteDocument document = new FavouriteDocument(id, guid);
|
||||
document.setName(name);
|
||||
document.setTitle(title);
|
||||
document.setCreatedBy(createdBy);
|
||||
document.setModifiedBy(modifiedBy);
|
||||
document.setModifiedAt(modifiedAt);
|
||||
document.setCreatedAt(createdAt);
|
||||
document.setDescription(description);
|
||||
document.setMimeType(mimeType);
|
||||
document.setSizeInBytes(BigInteger.valueOf(sizeInBytes));
|
||||
document.setVersionLabel(versionLabel);
|
||||
FavouriteDocument other = (FavouriteDocument)o;
|
||||
|
||||
AssertUtil.assertEquals("mimeType", mimeType, other.getMimeType());
|
||||
AssertUtil.assertEquals("sizeInBytes", sizeInBytes, other.getSizeInBytes());
|
||||
AssertUtil.assertEquals("versionLabel", versionLabel, other.getVersionLabel());
|
||||
}
|
||||
|
||||
public static FavouriteDocument parseDocument(JSONObject jsonObject) throws ParseException
|
||||
{
|
||||
String id = (String)jsonObject.get("id");
|
||||
String guid = (String)jsonObject.get("guid");
|
||||
String name = (String)jsonObject.get("name");
|
||||
String title = (String)jsonObject.get("title");
|
||||
String description = (String)jsonObject.get("description");
|
||||
Date createdAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("createdAt"));
|
||||
Date modifiedAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("modifiedAt"));
|
||||
String createdBy = (String)jsonObject.get("createdBy");
|
||||
String modifiedBy = (String)jsonObject.get("modifiedBy");
|
||||
String mimeType = (String)jsonObject.get("mimeType");
|
||||
Long sizeInBytes = (Long)jsonObject.get("sizeInBytes");
|
||||
String versionLabel = (String)jsonObject.get("versionLabel");
|
||||
|
||||
FavouriteDocument document = new FavouriteDocument(id, guid);
|
||||
document.setName(name);
|
||||
document.setTitle(title);
|
||||
document.setCreatedBy(createdBy);
|
||||
document.setModifiedBy(modifiedBy);
|
||||
document.setModifiedAt(modifiedAt);
|
||||
document.setCreatedAt(createdAt);
|
||||
document.setDescription(description);
|
||||
document.setMimeType(mimeType);
|
||||
document.setSizeInBytes(BigInteger.valueOf(sizeInBytes));
|
||||
document.setVersionLabel(versionLabel);
|
||||
// set path if available
|
||||
document.parseAndSetPath(jsonObject);
|
||||
return document;
|
||||
|
@@ -46,80 +46,80 @@ import org.json.simple.JSONObject;
|
||||
*/
|
||||
public class FavouriteFolder extends FavouriteNode implements ExpectedComparison, JSONAble
|
||||
{
|
||||
private static final long serialVersionUID = 5020819866533183524L;
|
||||
private static final long serialVersionUID = 5020819866533183524L;
|
||||
|
||||
/**
|
||||
* For POSTs
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteFolder(String guid)
|
||||
{
|
||||
super(guid);
|
||||
}
|
||||
|
||||
public FavouriteFolder(String id, String guid)
|
||||
{
|
||||
super(id, guid);
|
||||
}
|
||||
/**
|
||||
* For POSTs
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteFolder(String guid)
|
||||
{
|
||||
super(guid);
|
||||
}
|
||||
|
||||
// public Folder(String id, String guid, Map<String, Serializable> properties)
|
||||
// {
|
||||
// super(id, guid, properties);
|
||||
// }
|
||||
public FavouriteFolder(String id, String guid)
|
||||
{
|
||||
super(id, guid);
|
||||
}
|
||||
|
||||
public static FavouriteFolder getFolder(String id, String guid, Properties props)
|
||||
{
|
||||
FavouriteFolder folder = new FavouriteFolder(id, guid);
|
||||
// public Folder(String id, String guid, Map<String, Serializable> properties)
|
||||
// {
|
||||
// super(id, guid, properties);
|
||||
// }
|
||||
|
||||
Map<String, PropertyData<?>> properties = props.getProperties();
|
||||
folder.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
|
||||
folder.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
|
||||
folder.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
|
||||
folder.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
|
||||
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
|
||||
folder.setModifiedAt(modifiedAt.getTime());
|
||||
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
|
||||
folder.setCreatedAt(createdAt.getTime());
|
||||
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
|
||||
return folder;
|
||||
}
|
||||
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = super.toJSON();
|
||||
return json;
|
||||
}
|
||||
public static FavouriteFolder getFolder(String id, String guid, Properties props)
|
||||
{
|
||||
FavouriteFolder folder = new FavouriteFolder(id, guid);
|
||||
|
||||
public static FavouriteFolder parseFolder(JSONObject jsonObject) throws ParseException
|
||||
{
|
||||
String id = (String)jsonObject.get("id");
|
||||
String guid = (String)jsonObject.get("guid");
|
||||
String name = (String)jsonObject.get("name");
|
||||
String title = (String)jsonObject.get("title");
|
||||
String description = (String)jsonObject.get("description");
|
||||
Date createdAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("createdAt"));
|
||||
Date modifiedAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("modifiedAt"));
|
||||
String createdBy = (String)jsonObject.get("createdBy");
|
||||
String modifiedBy = (String)jsonObject.get("modifiedBy");
|
||||
Map<String, PropertyData<?>> properties = props.getProperties();
|
||||
folder.setName((String)properties.get(PropertyIds.NAME).getFirstValue());
|
||||
folder.setTitle((String)properties.get(ContentModel.PROP_TITLE.toString()).getFirstValue());
|
||||
folder.setCreatedBy((String)properties.get(PropertyIds.CREATED_BY).getFirstValue());
|
||||
folder.setModifiedBy((String)properties.get(PropertyIds.LAST_MODIFIED_BY).getFirstValue());
|
||||
GregorianCalendar modifiedAt = (GregorianCalendar)properties.get(PropertyIds.LAST_MODIFICATION_DATE).getFirstValue();
|
||||
folder.setModifiedAt(modifiedAt.getTime());
|
||||
GregorianCalendar createdAt = (GregorianCalendar)properties.get(PropertyIds.CREATION_DATE).getFirstValue();
|
||||
folder.setCreatedAt(createdAt.getTime());
|
||||
//document.setDescription((String)props.get(PropertyIds.DE).getFirstValue());
|
||||
return folder;
|
||||
}
|
||||
|
||||
FavouriteFolder folder = new FavouriteFolder(id, guid);
|
||||
folder.setName(name);
|
||||
folder.setTitle(title);
|
||||
folder.setCreatedBy(createdBy);
|
||||
folder.setModifiedBy(modifiedBy);
|
||||
folder.setModifiedAt(modifiedAt);
|
||||
folder.setCreatedAt(createdAt);
|
||||
folder.setDescription(description);
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = super.toJSON();
|
||||
return json;
|
||||
}
|
||||
|
||||
public static FavouriteFolder parseFolder(JSONObject jsonObject) throws ParseException
|
||||
{
|
||||
String id = (String)jsonObject.get("id");
|
||||
String guid = (String)jsonObject.get("guid");
|
||||
String name = (String)jsonObject.get("name");
|
||||
String title = (String)jsonObject.get("title");
|
||||
String description = (String)jsonObject.get("description");
|
||||
Date createdAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("createdAt"));
|
||||
Date modifiedAt = PublicApiDateFormat.getDateFormat().parse((String)jsonObject.get("modifiedAt"));
|
||||
String createdBy = (String)jsonObject.get("createdBy");
|
||||
String modifiedBy = (String)jsonObject.get("modifiedBy");
|
||||
|
||||
FavouriteFolder folder = new FavouriteFolder(id, guid);
|
||||
folder.setName(name);
|
||||
folder.setTitle(title);
|
||||
folder.setCreatedBy(createdBy);
|
||||
folder.setModifiedBy(modifiedBy);
|
||||
folder.setModifiedAt(modifiedAt);
|
||||
folder.setCreatedAt(createdAt);
|
||||
folder.setDescription(description);
|
||||
// set path if available
|
||||
folder.parseAndSetPath(jsonObject);
|
||||
return folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
super.expected(o);
|
||||
}
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
super.expected(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
|
@@ -43,138 +43,138 @@ import org.json.simple.JSONObject;
|
||||
*/
|
||||
public class FavouriteNode implements Serializable, ExpectedComparison
|
||||
{
|
||||
private static final long serialVersionUID = -6881545732441221372L;
|
||||
private static final long serialVersionUID = -6881545732441221372L;
|
||||
|
||||
protected String nodeId;
|
||||
protected String guid;
|
||||
protected String name;
|
||||
protected String title;
|
||||
protected String description;
|
||||
protected Date createdAt;
|
||||
protected Date modifiedAt;
|
||||
protected String createdBy;
|
||||
protected String modifiedBy;
|
||||
protected PathInfo path;
|
||||
protected String nodeId;
|
||||
protected String guid;
|
||||
protected String name;
|
||||
protected String title;
|
||||
protected String description;
|
||||
protected Date createdAt;
|
||||
protected Date modifiedAt;
|
||||
protected String createdBy;
|
||||
protected String modifiedBy;
|
||||
protected PathInfo path;
|
||||
|
||||
public FavouriteNode()
|
||||
{
|
||||
}
|
||||
public FavouriteNode()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* For POSTs
|
||||
*
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteNode(String guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
/**
|
||||
* For POSTs
|
||||
*
|
||||
* @param guid String
|
||||
*/
|
||||
public FavouriteNode(String guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public FavouriteNode(String id, String guid)
|
||||
{
|
||||
this.nodeId = id;
|
||||
this.guid = guid;
|
||||
}
|
||||
public FavouriteNode(String id, String guid)
|
||||
{
|
||||
this.nodeId = id;
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public void setGuid(String guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
public void setGuid(String guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
public String getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
public String getRawNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public String getRawNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public String getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
public String getNodeId()
|
||||
{
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public boolean isFolder()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public boolean isFolder()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public Date getModifiedAt()
|
||||
{
|
||||
return modifiedAt;
|
||||
}
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public void setModifiedAt(Date modifiedAt)
|
||||
{
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
public Date getModifiedAt()
|
||||
{
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public String getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setModifiedAt(Date modifiedAt)
|
||||
{
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
public String getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public String getModifiedBy()
|
||||
{
|
||||
return modifiedBy;
|
||||
}
|
||||
public void setCreatedBy(String createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(String modifiedBy)
|
||||
{
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
public String getModifiedBy()
|
||||
{
|
||||
return modifiedBy;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
public void setModifiedBy(String modifiedBy)
|
||||
{
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId)
|
||||
{
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public PathInfo getPath()
|
||||
{
|
||||
@@ -203,66 +203,66 @@ public class FavouriteNode implements Serializable, ExpectedComparison
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
|
||||
return result;
|
||||
}
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
FavouriteNode other = (FavouriteNode) obj;
|
||||
if (nodeId == null)
|
||||
{
|
||||
if (other.nodeId != null)
|
||||
return false;
|
||||
} else if (!nodeId.equals(other.nodeId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
FavouriteNode other = (FavouriteNode) obj;
|
||||
if (nodeId == null)
|
||||
{
|
||||
if (other.nodeId != null)
|
||||
return false;
|
||||
} else if (!nodeId.equals(other.nodeId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("guid", getGuid());
|
||||
json.put("id", getNodeId());
|
||||
return json;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public JSONObject toJSON()
|
||||
{
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("guid", getGuid());
|
||||
json.put("id", getNodeId());
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
assertTrue(o instanceof FavouriteNode);
|
||||
@Override
|
||||
public void expected(Object o)
|
||||
{
|
||||
assertTrue(o instanceof FavouriteNode);
|
||||
|
||||
FavouriteNode other = (FavouriteNode) o;
|
||||
FavouriteNode other = (FavouriteNode) o;
|
||||
|
||||
AssertUtil.assertEquals("id", nodeId, other.getNodeId());
|
||||
AssertUtil.assertEquals("guid", guid, other.getGuid());
|
||||
AssertUtil.assertEquals("name", name, other.getName());
|
||||
AssertUtil.assertEquals("title", title, other.getTitle());
|
||||
AssertUtil.assertEquals("description", description, other.getDescription());
|
||||
AssertUtil.assertEquals("createdAt", createdAt, other.getCreatedAt());
|
||||
if(modifiedAt != null)
|
||||
{
|
||||
assertTrue(modifiedAt.before(other.getModifiedAt()) || modifiedAt.equals(other.getModifiedAt()));
|
||||
}
|
||||
AssertUtil.assertEquals("createdBy", createdBy, other.getCreatedBy());
|
||||
AssertUtil.assertEquals("modifiedBy", modifiedBy, other.getModifiedBy());
|
||||
if(path != null)
|
||||
AssertUtil.assertEquals("id", nodeId, other.getNodeId());
|
||||
AssertUtil.assertEquals("guid", guid, other.getGuid());
|
||||
AssertUtil.assertEquals("name", name, other.getName());
|
||||
AssertUtil.assertEquals("title", title, other.getTitle());
|
||||
AssertUtil.assertEquals("description", description, other.getDescription());
|
||||
AssertUtil.assertEquals("createdAt", createdAt, other.getCreatedAt());
|
||||
if(modifiedAt != null)
|
||||
{
|
||||
assertTrue(modifiedAt.before(other.getModifiedAt()) || modifiedAt.equals(other.getModifiedAt()));
|
||||
}
|
||||
AssertUtil.assertEquals("createdBy", createdBy, other.getCreatedBy());
|
||||
AssertUtil.assertEquals("modifiedBy", modifiedBy, other.getModifiedBy());
|
||||
if(path != null)
|
||||
{
|
||||
path.expected(other.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
|
Reference in New Issue
Block a user