com.turbospaces.rpc.DefaultGrpcApiResponseEntity Maven / Gradle / Ivy
package com.turbospaces.rpc;
import java.util.Objects;
import com.google.protobuf.Message;
import com.turbospaces.api.facade.ResponseStatusFacade;
import api.v1.CacheControl;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
@AllArgsConstructor(access = AccessLevel.PUBLIC)
public class DefaultGrpcApiResponseEntity implements ApiResponseEntity {
private final ResponseStatusFacade status;
private final api.v1.CacheControl cacheControl;
private final T resp;
@Override
public ResponseStatusFacade status() {
return status;
}
@Override
public boolean hasBody() {
return Objects.nonNull(resp);
}
@Override
public T body() {
return resp;
}
@Override
public CacheControl cacheControl() {
return cacheControl;
}
}