Package de.murmelmeister.murmelapi.redis
Record Class RefreshMessage
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.redis.RefreshMessage
public record RefreshMessage(String sender, String type, com.google.gson.JsonElement key)
extends Record
The key retains its JSON type; providers receive the same JSON representation as the old bridge.
-
Constructor Summary
ConstructorsConstructorDescriptionRefreshMessage(String sender, String type, com.google.gson.JsonElement key) Creates an instance of aRefreshMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(RefreshProvider provider, com.google.gson.Gson gson) static RefreshMessagefinal booleanIndicates whether some other object is "equal to" this one.static RefreshMessagefromEvent(String sender, RefreshEvent<?> event, com.google.gson.Gson gson) final inthashCode()Returns a hash code value for this object.com.google.gson.JsonElementkey()Returns the value of thekeyrecord component.keyJson(com.google.gson.Gson gson) sender()Returns the value of thesenderrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
RefreshMessage
Creates an instance of aRefreshMessagerecord class.- Parameters:
sender- the value for thesenderrecord componenttype- the value for thetyperecord componentkey- the value for thekeyrecord component
-
-
Method Details
-
fromEvent
public static RefreshMessage fromEvent(String sender, RefreshEvent<?> event, com.google.gson.Gson gson) -
decode
-
keyJson
-
apply
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
sender
Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
key
public com.google.gson.JsonElement key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-