Package energy.eddie.aiida.utils
Class AiidaRecordConverter
java.lang.Object
energy.eddie.aiida.utils.AiidaRecordConverter
-
Method Summary
Modifier and TypeMethodDescriptionstatic LatestDataSourceRecordDtorecordToLatestDto(AiidaRecord aiidaRecord, DataSource dataSource) Converts anAiidaRecordto aLatestDataSourceRecordDto.static AiidaRecordStreamingDtorecordToStreamingDto(AiidaRecord aiidaRecord, Permission permission) Converts anAiidaRecordto aAiidaRecordStreamingDtoby adding the required metadata from the permission.
-
Method Details
-
recordToStreamingDto
public static AiidaRecordStreamingDto recordToStreamingDto(AiidaRecord aiidaRecord, Permission permission) Converts anAiidaRecordto aAiidaRecordStreamingDtoby adding the required metadata from the permission.- Parameters:
aiidaRecord- The record to convert.permission- Permission which contains the metadata that should be added to the DTO.- Returns:
- AiidaRecordStreamingDto with its fields populated.
- Throws:
IllegalArgumentException- If the aiidaRecord is an inheritor which has no implementation in this method.
-
recordToLatestDto
public static LatestDataSourceRecordDto recordToLatestDto(AiidaRecord aiidaRecord, DataSource dataSource) Converts anAiidaRecordto aLatestDataSourceRecordDto.- Parameters:
aiidaRecord- The record to convert.dataSource- The data source which contains the metadata that should be added to the DTO.- Returns:
- LatestAiidaRecordDto with its fields populated.
-