io.proximax.service.CreateProximaxMessagePayloadService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-chain-xipfs-sdk Show documentation
Show all versions of java-chain-xipfs-sdk Show documentation
Official ProximaX P2P Storage SDK Library in Java.
The newest version!
package io.proximax.service;
import io.proximax.model.ProximaxDataModel;
import io.proximax.model.ProximaxMessagePayloadModel;
import io.proximax.upload.UploadParameter;
import io.reactivex.Observable;
import static io.proximax.utils.ParameterValidationUtils.checkParameter;
/**
* The service class responsible for creating a message payload
*/
public class CreateProximaxMessagePayloadService {
/**
* Creates a message payload
* @param uploadParameter the upload parameter
* @param uploadedData an uploaded data object
* @return the created message payload
*/
public Observable createMessagePayload(UploadParameter uploadParameter, ProximaxDataModel uploadedData) {
checkParameter(uploadParameter != null, "uploadParameter is required");
checkParameter(uploadedData != null, "uploadedData is required");
return Observable.just(ProximaxMessagePayloadModel.create(uploadParameter.getPrivacyStrategy().getPrivacyType(),
uploadParameter.getVersion(), uploadedData));
}
}