The data retriever chain is now localized

This commit is contained in:
Lennart Hensler committed 2014-11-05 16:43:06 +01:00
1 parent bc8fc9a292
commit b3535677be
21 files changed
+290 -53

No files matched your search

@@ -13,7 +13,7 @@ public class DataRetrieverChainDefinitionDTO implements Serializable, Comparable
private String name;
private String dataSourceTypeName;
private List<String> retrievedDataTypesChain;
private List<LocalizedTypeDTO> retrievedDataTypesChain;
/**
* <b>Constructor for the GWT-Serialization. Don't use this!</b>
@@ -21,7 +21,7 @@ public class DataRetrieverChainDefinitionDTO implements Serializable, Comparable
@Deprecated
DataRetrieverChainDefinitionDTO() { }
public DataRetrieverChainDefinitionDTO(UUID id, String name, String dataSourceTypeName, Collection<String> retrievedDataTypesChain) {
public DataRetrieverChainDefinitionDTO(UUID id, String name, String dataSourceTypeName, Collection<LocalizedTypeDTO> retrievedDataTypesChain) {
this.id = id;
this.name = name;
this.dataSourceTypeName = dataSourceTypeName;
@@ -42,10 +42,10 @@ public class DataRetrieverChainDefinitionDTO implements Serializable, Comparable
}
public String getRetrievedDataTypeName() {
return retrievedDataTypesChain.get(retrievedDataTypesChain.size() - 1);
return retrievedDataTypesChain.get(retrievedDataTypesChain.size() - 1).getTypeName();
}
public List<String> getRetrievedDataTypesChain() {
public List<LocalizedTypeDTO> getRetrievedDataTypesChain() {
return retrievedDataTypesChain;
}
@@ -53,5 +53,48 @@ public class DataRetrieverChainDefinitionDTO implements Serializable, Comparable
public int compareTo(DataRetrieverChainDefinitionDTO d) {
return this.getName().compareTo(d.getName());
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((dataSourceTypeName == null) ? 0 : dataSourceTypeName.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((retrievedDataTypesChain == null) ? 0 : retrievedDataTypesChain.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;
DataRetrieverChainDefinitionDTO other = (DataRetrieverChainDefinitionDTO) obj;
if (dataSourceTypeName == null) {
if (other.dataSourceTypeName != null)
return false;
} else if (!dataSourceTypeName.equals(other.dataSourceTypeName))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (retrievedDataTypesChain == null) {
if (other.retrievedDataTypesChain != null)
return false;
} else if (!retrievedDataTypesChain.equals(other.retrievedDataTypesChain))
return false;
return true;
}
}
@@ -0,0 +1,61 @@
package com.sap.sse.datamining.shared.impl.dto;
import java.io.Serializable;
public class LocalizedTypeDTO implements Serializable {
private static final long serialVersionUID = -5976605483497225403L;
private String typeName;
private String displayName;
/**
* <b>Constructor for the GWT-Serialization. Don't use this!</b>
*/
@Deprecated
LocalizedTypeDTO() { }
public LocalizedTypeDTO(String typeName, String displayName) {
this.typeName = typeName;
this.displayName = displayName;
}
public String getTypeName() {
return typeName;
}
public String getDisplayName() {
return displayName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
result = prime * result + ((typeName == null) ? 0 : typeName.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;
LocalizedTypeDTO other = (LocalizedTypeDTO) obj;
if (displayName == null) {
if (other.displayName != null)
return false;
} else if (!displayName.equals(other.displayName))
return false;
if (typeName == null) {
if (other.typeName != null)
return false;
} else if (!typeName.equals(other.typeName))
return false;
return true;
}
}