com.openelements.hiero.base.protocol.TopicMessageRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hiero-enterprise-base Show documentation
Show all versions of hiero-enterprise-base Show documentation
Base Library to work with Hiero in Spring and JakartaEE
The newest version!
package com.openelements.hiero.base.protocol;
import com.hedera.hashgraph.sdk.Hbar;
import com.hedera.hashgraph.sdk.TopicId;
import com.hedera.hashgraph.sdk.TopicMessage;
import java.time.Instant;
import java.util.Objects;
import java.util.function.Consumer;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
public record TopicMessageRequest(@NonNull TopicId topicId, @NonNull Consumer subscription,
@Nullable Instant startTime, @Nullable Instant endTime,
long limit,
Hbar queryPayment, Hbar maxQueryPayment) implements
QueryRequest {
private final static long NO_LIMIT = -1;
public TopicMessageRequest {
Objects.requireNonNull(topicId, "topicId must not be null");
Objects.requireNonNull(subscription, "subscription must not be null");
}
@NonNull
public static TopicMessageRequest of(@NonNull TopicId topicId, @NonNull Consumer subscription) {
return new TopicMessageRequest(topicId, subscription, null, null, NO_LIMIT, null, null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy