Some checks failed
DCO / DCO (pull_request) Failing after 27s
Signed-off-by: Ori Bruk <o.bruk@yadro.com>
24 lines
633 B
Java
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();
|
|
}
|
|
}
|