package info.frostfs.sdk.mappers; import frostfs.session.Types; import info.frostfs.sdk.dto.MetaHeader; import static java.util.Objects.isNull; public class MetaHeaderMapper { private MetaHeaderMapper() { } public static Types.RequestMetaHeader toGrpcMessage(MetaHeader metaHeader) { if (isNull(metaHeader)) { return null; } return Types.RequestMetaHeader.newBuilder() .setVersion(VersionMapper.toGrpcMessage(metaHeader.getVersion())) .setEpoch(metaHeader.getEpoch()) .setTtl(metaHeader.getTtl()) .build(); } }