PR comments fx
This commit is contained in:
parent
fc999212ce
commit
68ee46d789
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.provectus.kafka.ui.model;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.provectus.kafka.ui.exception.ValidationException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -14,9 +15,12 @@ public record ConsumerPosition(PollingModeDTO pollingMode,
|
|||
@Nullable Long timestamp,
|
||||
@Nullable Offsets offsets) {
|
||||
|
||||
// one of properties will be null
|
||||
public record Offsets(@Nullable Long offset, //should be applied to all partitions
|
||||
@Nullable Map<TopicPartition, Long> tpOffsets) {
|
||||
public Offsets {
|
||||
// only one of properties should be set
|
||||
Preconditions.checkArgument((offset == null && tpOffsets != null) || (offset != null && tpOffsets == null));
|
||||
}
|
||||
}
|
||||
|
||||
public static ConsumerPosition create(PollingModeDTO pollingMode,
|
||||
|
|
Loading…
Add table
Reference in a new issue