stendhal/tests/conf/PortalTestObject.java

63 lines
1.8 KiB
Java
Raw Permalink Normal View History

2010-09-19 01:29:21 +00:00
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
***************************************************************************
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
package conf;
public class PortalTestObject {
private final String zone;
2007-08-15 21:16:46 +00:00
private final String name;
2007-08-15 21:16:46 +00:00
private final String destZone;
2007-08-15 21:16:46 +00:00
private final String destName;
2007-08-15 21:16:46 +00:00
PortalTestObject(final String zone, final String name, final String destZone, final String destName) {
super();
this.zone = zone;
this.name = name;
this.destZone = destZone;
this.destName = destName;
}
2007-08-15 21:16:46 +00:00
public PortalTestObject() {
2007-08-15 21:16:46 +00:00
zone = "";
name = "";
destZone = "";
destName = "";
}
2007-08-15 21:16:46 +00:00
boolean isDestinationOf(final PortalTestObject source) {
2007-08-15 21:16:46 +00:00
if (source == null) {
return false;
}
if ("".equals(source.destName) || "".equals(source.destZone)) {
return false;
}
2007-08-15 21:16:46 +00:00
return this.name.equals(source.destName)
&& this.zone.equals(source.destZone);
}
2007-08-15 21:16:46 +00:00
public boolean hasDestination() {
2007-08-15 21:16:46 +00:00
return !("".equals(destName) && "".equals(destZone));
}
2007-08-15 21:16:46 +00:00
@Override
public String toString() {
2007-08-15 21:16:46 +00:00
return "ref: (" + zone + " / " + name + ") -> (" + destZone + "/"
+ destName + ")";
}
}