diff --git a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java index 1b5b300..9f7b29d 100644 --- a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java +++ b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/shared/TRId.java @@ -19,12 +19,11 @@ public class TRId implements Serializable { * Tabular resource id */ private String id; - + /** * TabResourceType: Standard, Flow.... */ private TabResourceType tabResourceType; - /** * Tabular resource type: Generic, Codelist, Dataset... @@ -46,19 +45,27 @@ public class TRId implements Serializable { * reference to associated table */ private String referenceTargetTableId; - + /** * True if tableId identifies a View */ private boolean viewTable; + + public static TRId newInstance(TRId trId) { + return new TRId(trId.getId(), trId.getTabResourceType(), + trId.getTableTypeName(), trId.getTableId(), + trId.getTableType(), trId.getReferenceTargetTableId(), + trId.isViewTable()); + } + public TRId() { } public TRId(String id) { this.id = id; - tabResourceType=null; + tabResourceType = null; tableTypeName = null; tableId = null; tableType = null; @@ -69,7 +76,7 @@ public class TRId implements Serializable { public TRId(String id, TabResourceType tabResourceType, String tableId) { this.id = id; - this.tabResourceType=tabResourceType; + this.tabResourceType = tabResourceType; tableTypeName = null; this.tableId = tableId; tableType = null; @@ -78,8 +85,8 @@ public class TRId implements Serializable { } - public TRId(String id, TabResourceType tabResourceType, String tableTypeName, - String tableId, String tableType) { + public TRId(String id, TabResourceType tabResourceType, + String tableTypeName, String tableId, String tableType) { this.id = id; this.tableTypeName = tableTypeName; this.tableId = tableId; @@ -88,8 +95,9 @@ public class TRId implements Serializable { viewTable = false; } - public TRId(String id, TabResourceType tabResourceType, String tableTypeName, - String tableId, String tableType, String referenceTargetTableId, boolean viewTable) { + public TRId(String id, TabResourceType tabResourceType, + String tableTypeName, String tableId, String tableType, + String referenceTargetTableId, boolean viewTable) { this.id = id; this.tableTypeName = tableTypeName; this.tableId = tableId; @@ -105,8 +113,7 @@ public class TRId implements Serializable { public void setId(String id) { this.id = id; } - - + public TabResourceType getTabResourceType() { return tabResourceType; } @@ -175,7 +182,4 @@ public class TRId implements Serializable { + referenceTargetTableId + ", viewTable=" + viewTable + "]"; } - - - }