Class AiidaRecordConverter

java.lang.Object
energy.eddie.aiida.utils.AiidaRecordConverter

public class AiidaRecordConverter extends Object
  • Method Details

    • recordToStreamingDto

      public static AiidaRecordStreamingDto recordToStreamingDto(AiidaRecord aiidaRecord, Permission permission)
      Converts an AiidaRecord to a AiidaRecordStreamingDto by 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)
      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.