use of org.eclipse.scanning.api.scan.models.ScanMetadata in project gda-core by openGDA.
the class ClausesContext method setSampleMetadata.
/**
* Sets the supplied {@link String} of sample metadata key names and values for the scan and prevents any
* further changes to this being made.
*
* @param metadataDefs A pipe separated {@link String} containing pairs of metadata key names and values
* in the form "keyname1::value1|keyname2::value2"
*/
private void setSampleMetadata(String metadataDefs) {
if (!acceptingSampleMetadata) {
throw new IllegalStateException("Sample metadata has already been set for this mscan");
}
sampleMetadata = new ScanMetadata(MetadataType.SAMPLE);
Stream.of(metadataDefs.split("\\|")).map(x -> x.split("::")).forEach(this::fillMetadata);
acceptingSampleMetadata = false;
}
Aggregations