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

com.casper.sdk.service.impl.event.AbstractEvent Maven / Gradle / Ivy

Go to download

SDK to streamline the 3rd party Java client integration processes. Such 3rd parties include exchanges & app developers.

The newest version!
package com.casper.sdk.service.impl.event;

import com.casper.sdk.model.event.DataType;
import com.casper.sdk.model.event.Event;
import lombok.*;

import java.util.Optional;

/**
 * The abstract base class implementation for all events
 *
 * @param  the type of the event data
 * @author [email protected]
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PACKAGE)
@ToString(doNotUseGetters = true)
@EqualsAndHashCode(of = {"source", "id"})
abstract class AbstractEvent implements Event {

    /** The type of the data field */
    private final DataType dataType;
    /** The source node of the event */
    private final String source;
    /** The ID of the event */
    private final Long id;
    /** The event data */
    private final T data;
    /** The version of the casper API that generate the event */
    private final String version;

    public Optional getId() {
        return Optional.ofNullable(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy