All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.spring.messaging.eventhubs.implementation.support.EventDataHelper Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.spring.messaging.eventhubs.implementation.support;

import com.azure.messaging.eventhubs.EventData;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Helper class to process {@link EventData}.
 */
public final class EventDataHelper {

    private EventDataHelper() {
    }

    /**
     * Convert the {@link EventData} to the strings.
     * @param eventData the event data.
     * @return the strings.
     */
    public static String toString(EventData eventData) {
        Map map = new LinkedHashMap<>();

        map.put("body", eventData.getBodyAsString());
        map.put("offset", eventData.getOffset());
        map.put("sequenceNumber", eventData.getSequenceNumber());
        map.put("enqueuedTime", eventData.getEnqueuedTime());

        return map.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy