mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
removed X suffix
This commit is contained in:
@@ -63,25 +63,25 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
|
|||||||
lastModified = c;
|
lastModified = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String createKeyX(NamespaceAndName namespaceAndName)
|
static String createKey(NamespaceAndName namespaceAndName)
|
||||||
{
|
{
|
||||||
return namespaceAndName.getNamespace() + ":" + namespaceAndName.getName();
|
return namespaceAndName.getNamespace() + ":" + namespaceAndName.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
static String createKeyX(Repository repository)
|
static String createKey(Repository repository)
|
||||||
{
|
{
|
||||||
return createKeyX(repository.getNamespaceAndName());
|
return createKey(repository.getNamespaceAndName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(Repository repository)
|
public void add(Repository repository)
|
||||||
{
|
{
|
||||||
repositoryMap.put(createKeyX(repository), repository);
|
repositoryMap.put(createKey(repository), repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(NamespaceAndName namespaceAndName)
|
public boolean contains(NamespaceAndName namespaceAndName)
|
||||||
{
|
{
|
||||||
return repositoryMap.containsKey(createKeyX(namespaceAndName));
|
return repositoryMap.containsKey(createKey(namespaceAndName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -92,12 +92,12 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
|
|||||||
|
|
||||||
public boolean contains(Repository repository)
|
public boolean contains(Repository repository)
|
||||||
{
|
{
|
||||||
return repositoryMap.containsKey(createKeyX(repository));
|
return repositoryMap.containsKey(createKey(repository));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeX(Repository repository)
|
public void remove(Repository repository)
|
||||||
{
|
{
|
||||||
repositoryMap.remove(createKeyX(repository));
|
repositoryMap.remove(createKey(repository));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -105,7 +105,7 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
|
|||||||
{
|
{
|
||||||
Repository r = get(id);
|
Repository r = get(id);
|
||||||
|
|
||||||
removeX(r);
|
remove(r);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
|
|||||||
|
|
||||||
public Repository get(NamespaceAndName namespaceAndName)
|
public Repository get(NamespaceAndName namespaceAndName)
|
||||||
{
|
{
|
||||||
return repositoryMap.get(createKeyX(namespaceAndName));
|
return repositoryMap.get(createKey(namespaceAndName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -47,47 +47,19 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
*/
|
*/
|
||||||
public class XmlRepositoryMapAdapter
|
public class XmlRepositoryMapAdapter extends XmlAdapter<XmlRepositoryList, Map<String, Repository>> {
|
||||||
extends XmlAdapter<XmlRepositoryList, Map<String, Repository>>
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param repositoryMap
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public XmlRepositoryList marshal(Map<String, Repository> repositoryMap)
|
public XmlRepositoryList marshal(Map<String, Repository> repositoryMap) {
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
return new XmlRepositoryList(repositoryMap);
|
return new XmlRepositoryList(repositoryMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param repositories
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Repository> unmarshal(XmlRepositoryList repositories)
|
public Map<String, Repository> unmarshal(XmlRepositoryList repositories) {
|
||||||
throws Exception
|
Map<String, Repository> repositoryMap = new LinkedHashMap<>();
|
||||||
{
|
|
||||||
Map<String, Repository> repositoryMap = new LinkedHashMap<String,
|
|
||||||
Repository>();
|
|
||||||
|
|
||||||
for (Repository repository : repositories)
|
for (Repository repository : repositories) {
|
||||||
{
|
repositoryMap.put(XmlRepositoryDatabase.createKey(repository),
|
||||||
repositoryMap.put(XmlRepositoryDatabase.createKeyX(repository),
|
|
||||||
repository);
|
repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user