Record Class DefaultDataSyncHandler<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.node.impl.cluster.sync.DefaultDataSyncHandler<T>
- All Implemented Interfaces:
eu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>
public record DefaultDataSyncHandler<T>(@NonNull String key, boolean alwaysForceApply, @NonNull eu.cloudnetservice.node.cluster.sync.DataSyncHandler.DataConverter<T> converter, @NonNull Consumer<T> writer, @NonNull UnaryOperator<T> currentGetter, @NonNull Function<T,String> nameExtractor, @NonNull Supplier<Collection<T>> dataCollector)
extends Record
implements eu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface eu.cloudnetservice.node.cluster.sync.DataSyncHandler
eu.cloudnetservice.node.cluster.sync.DataSyncHandler.DataConverter<T2> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for thealwaysForceApplyrecord component.The field for theconverterrecord component.private final @NonNull UnaryOperator<T> The field for thecurrentGetterrecord component.private final @NonNull Supplier<Collection<T>> The field for thedataCollectorrecord component.The field for thekeyrecord component.The field for thenameExtractorrecord component.The field for thewriterrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDataSyncHandler(@NonNull String key, boolean alwaysForceApply, @NonNull eu.cloudnetservice.node.cluster.sync.DataSyncHandler.DataConverter<T> converter, @NonNull Consumer<T> writer, @NonNull UnaryOperator<T> currentGetter, @NonNull Function<T, String> nameExtractor, @NonNull Supplier<Collection<T>> dataCollector) Creates an instance of aDefaultDataSyncHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thealwaysForceApplyrecord component.static <T> @NonNull DefaultDataSyncHandler.Builder<T> builder()Returns the value of theconverterrecord component.Returns the value of thecurrentGetterrecord component.data()Returns the value of thedataCollectorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of thenameExtractorrecord component.voidfinal StringtoString()Returns a string representation of this record class.voidwriter()Returns the value of thewriterrecord component.
-
Field Details
-
key
-
alwaysForceApply
private final boolean alwaysForceApplyThe field for thealwaysForceApplyrecord component. -
converter
-
writer
-
currentGetter
The field for thecurrentGetterrecord component. -
nameExtractor
-
dataCollector
The field for thedataCollectorrecord component.
-
-
Constructor Details
-
DefaultDataSyncHandler
public DefaultDataSyncHandler(@NonNull @NonNull String key, boolean alwaysForceApply, @NonNull @NonNull eu.cloudnetservice.node.cluster.sync.DataSyncHandler.DataConverter<T> converter, @NonNull @NonNull Consumer<T> writer, @NonNull @NonNull UnaryOperator<T> currentGetter, @NonNull @NonNull Function<T, String> nameExtractor, @NonNull @NonNull Supplier<Collection<T>> dataCollector) Creates an instance of aDefaultDataSyncHandlerrecord class.- Parameters:
key- the value for thekeyrecord componentalwaysForceApply- the value for thealwaysForceApplyrecord componentconverter- the value for theconverterrecord componentwriter- the value for thewriterrecord componentcurrentGetter- the value for thecurrentGetterrecord componentnameExtractor- the value for thenameExtractorrecord componentdataCollector- the value for thedataCollectorrecord component
-
-
Method Details
-
builder
-
name
-
write
-
serialize
-
current
-
data
- Specified by:
datain interfaceeu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
-
alwaysForceApply
public boolean alwaysForceApply()Returns the value of thealwaysForceApplyrecord component.- Specified by:
alwaysForceApplyin interfaceeu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>- Returns:
- the value of the
alwaysForceApplyrecord component
-
converter
@NonNull public @NonNull eu.cloudnetservice.node.cluster.sync.DataSyncHandler.DataConverter<T> converter()Returns the value of theconverterrecord component.- Specified by:
converterin interfaceeu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>- Returns:
- the value of the
converterrecord component
-
writer
-
currentGetter
Returns the value of thecurrentGetterrecord component.- Specified by:
currentGetterin interfaceeu.cloudnetservice.node.cluster.sync.DataSyncHandler<T>- Returns:
- the value of the
currentGetterrecord component
-
nameExtractor
-
dataCollector
-