{
this.properties = new Hashtable<String, Object>();
}
+ if (key!=null && value==null)
+ {
+ properties.remove(key);
+ return;
+ }
+ // null key throws a runtime exception
properties.put(key, value);
}
public void setTempFacType(TFType tempfactype)
{
- setProperty(TEMPFACTYPE, tempfactype);
+ setProperty(TEMPFACTYPE, tempfactype.name());
}
/**
}
public TFType getTempFacTypeTFType()
{
- return TFType.valueOf((String) getProperty(TEMPFACTYPE));
+ if (_hasProperty(TEMPFACTYPE)) {
+ return TFType.valueOf((String) getProperty(TEMPFACTYPE));
+ }
+ return null;
}
public boolean hasTempFacType()
}
public DataSourceType getProtocol()
{
- return DataSourceType.valueOf((String) getProperty(PROTOCOL));
+ if (_hasProperty(PROTOCOL))
+ {
+ return DataSourceType.valueOf((String) getProperty(PROTOCOL));
+ }
+ // default protocol is
+ return DataSourceType.FILE;
}
}
\ No newline at end of file
import jalview.datamodel.PDBEntry.Type;
import jalview.gui.JvOptionPane;
+import jalview.structure.StructureImportSettings.TFType;
//import org.testng.Assert;
import org.testng.annotations.AfterMethod;
}
}
+ @Test(groups= {"Functional"})
+ public void testMetadataProperties()
+ {
+ PDBEntry pdb = new PDBEntry("af:1xyz","A",null,"a/b/c/File");
+ assertEquals(pdb.getTempFacTypeTFType(),null);
+ }
}