frostfs-sdk-java/models/src/main/java/info/frostfs/sdk/mappers/MetaHeaderMapper.java
Bruk Ori 05ac5bb070
Some checks failed
DCO / DCO (pull_request) Failing after 27s
[#XX] provide additional security
Signed-off-by: Ori Bruk <o.bruk@yadro.com>
2024-07-24 14:41:42 +03:00

24 lines
633 B
Java

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();
}
}