@Override public Object clone(){ return new VersionProperty(myName, myNumber); } }
/** * * @return */ public VersionProperty getVersion(){ String name = myVersionNameTxtBox.getText(); String number = myVersionNumberTxtBox.getText(); VersionProperty version = new VersionProperty(name, number); return version; } /** This method is called from within the constructor to
private static VersionProperty getVersion(Property p) throws IllegalAccessException, InvocationTargetException{ if(p == null){ return new VersionProperty("", ""); } Object val = p.getValue(); if(val instanceof VersionProperty){ return (VersionProperty)val; } return new VersionProperty("", ""); } }
/** * Reads a VersionProperty from a XML node. * @param config XML node of the VersionProperty * @return VersionProperty from a XML node */ public static VersionProperty readVersion(HierarchicalConfiguration config){ String name = config.getString(XML_VERSION_NAME); String num = config.getString(XML_VERSION_NUMBER); return new VersionProperty(name, num); }