ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PayloadDto Class Reference

#include <CrestModel.h>

Collaboration diagram for PayloadDto:

Public Member Functions

json to_json () const
 

Static Public Member Functions

static PayloadDto from_json (const json &j)
 

Public Attributes

std::string hash
 
std::string version
 
std::string objectType
 
std::string objectName
 
std::string compressionType
 
std::string checkSum
 
int size
 
std::optional< std::string > insertionTime
 

Detailed Description

Definition at line 344 of file CrestModel.h.

Member Function Documentation

◆ from_json()

PayloadDto PayloadDto::from_json ( const json j)
static

Definition at line 627 of file CrestModel.cxx.

628 {
629  PayloadDto payloadDto;
630  payloadDto.hash = j.value("hash", "");
631  payloadDto.version = j.value("version", "");
632  payloadDto.objectType = j.value("objectType", "");
633  payloadDto.objectName = j.value("objectName", "");
634  payloadDto.compressionType = j.value("compressionType", "");
635  payloadDto.checkSum = j.value("checkSum", "");
636  payloadDto.size = j.value("size", 0);
637  if (j.contains(std::string{"insertionTime"}))
638  payloadDto.insertionTime = j.value("insertionTime", "");
639  return payloadDto;
640 }

◆ to_json()

json PayloadDto::to_json ( ) const

Definition at line 610 of file CrestModel.cxx.

611 {
612  json payloadDto = {};
613  payloadDto["hash"] = hash;
614  payloadDto["version"] = version;
615  payloadDto["objectType"] = objectType;
616  payloadDto["objectName"] = objectName;
617  payloadDto["compressionType"] = compressionType;
618  payloadDto["checkSum"] = checkSum;
619  payloadDto["size"] = size;
620  if (insertionTime.has_value())
621  payloadDto["insertionTime"] = insertionTime.value();
622  return payloadDto;
623 }

Member Data Documentation

◆ checkSum

std::string PayloadDto::checkSum

Definition at line 352 of file CrestModel.h.

◆ compressionType

std::string PayloadDto::compressionType

Definition at line 351 of file CrestModel.h.

◆ hash

std::string PayloadDto::hash

Definition at line 347 of file CrestModel.h.

◆ insertionTime

std::optional<std::string> PayloadDto::insertionTime

Definition at line 354 of file CrestModel.h.

◆ objectName

std::string PayloadDto::objectName

Definition at line 350 of file CrestModel.h.

◆ objectType

std::string PayloadDto::objectType

Definition at line 349 of file CrestModel.h.

◆ size

int PayloadDto::size

Definition at line 353 of file CrestModel.h.

◆ version

std::string PayloadDto::version

Definition at line 348 of file CrestModel.h.


The documentation for this class was generated from the following files:
PayloadDto::size
int size
Definition: CrestModel.h:353
json
nlohmann::json json
Definition: HistogramDef.cxx:9
PayloadDto::insertionTime
std::optional< std::string > insertionTime
Definition: CrestModel.h:354
PayloadDto
Definition: CrestModel.h:345
PayloadDto::version
std::string version
Definition: CrestModel.h:348
PayloadDto::objectType
std::string objectType
Definition: CrestModel.h:349
PayloadDto::objectName
std::string objectName
Definition: CrestModel.h:350
PayloadDto::checkSum
std::string checkSum
Definition: CrestModel.h:352
PayloadDto::compressionType
std::string compressionType
Definition: CrestModel.h:351
PayloadDto::hash
std::string hash
Definition: CrestModel.h:347