![JAR search and dependency download from the Maven repository](/logo.png)
io.timson.firehose.request.PutRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of firehose-mock Show documentation
Show all versions of firehose-mock Show documentation
An embedded Java mock for AWS Kinesis Firehose
package io.timson.firehose.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.Base64;
import java.util.Map;
import static java.nio.charset.StandardCharsets.UTF_8;
public class PutRequest {
private static final ObjectMapper mapper = new ObjectMapper();
@JsonProperty("DeliveryStreamName")
private String deliveryStream;
private String data;
@JsonProperty("Record")
public void setData(Map record) {
String encodedData = record.get("Data");
byte[] decodedData = Base64.getDecoder().decode(encodedData);
this.data = new String(decodedData, UTF_8);
}
public static PutRequest fromJson(String json) throws IOException {
return mapper.readValue(json, PutRequest.class);
}
public String getDeliveryStream() {
return deliveryStream;
}
public String getData() {
return data;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy