public final class StructureRecords extends Object
Modifier and Type | Method and Description |
---|---|
static StructureRecord |
ofMolecule(Molecule mol)
Wrap a Molecule into a Structure record.
|
static StructureRecord |
ofParseError(Exception e,
String src)
Wrap a failed parse.
|
static StructureRecord |
ofSource(String source,
String opts)
Create a record from a single structure source.
|
static Function<String,StructureRecord> |
ofSourceFunction(String opts)
Transform structure sources into
StructureRecord instances. |
public static StructureRecord ofParseError(Exception e, String src)
e
- Parse error to wrapsrc
- Structure source to returnpublic static StructureRecord ofMolecule(Molecule mol)
StructureRecord.getSource()
is in MRV format. MRV conversion is not
deferred, it is invoked before returning.mol
- Molecule to wrapIllegalArgumentException
- when MRV conversion failspublic static Function<String,StructureRecord> ofSourceFunction(String opts)
StructureRecord
instances.opts
- null
or import options to pass to underlying
MolImporter.importMol(java.lang.String, java.lang.String)
public static StructureRecord ofSource(String source, String opts)
StructureRecord
API contracts.source
- Structure source to pass to underlying. Can not be null or empty.
MolImporter.importMol(java.lang.String, java.lang.String)
opts
- null
or import options to pass to underlying
MolImporter.importMol(java.lang.String, java.lang.String)