changed setId method of gate class

This commit is contained in:
Tobias Ottenweller 2012-05-16 22:58:34 +02:00
parent d605e54a1c
commit c5490270de

View File

@ -46,13 +46,17 @@ public class Gate extends BaseGate implements ConfigurationSerializable
} }
public void setId(String id) throws Exception /**
* @return true if the id has been changed; false otherwise
*/
public boolean setId(String id)
{ {
if (instances.get(id) != null) { if (!exists(id)) {
throw new Exception("Cannot set new ID: this ID is already in use"); this.id = id;
return true;
} }
this.id = id; return false;
} }
@ -112,7 +116,7 @@ public class Gate extends BaseGate implements ConfigurationSerializable
/* /*
* PERSISTANCE and ENTITY MANAGEMENT * ENTITY MANAGEMENT
*/ */
public static Gate get(String id) public static Gate get(String id)