Record Class FlagValueAdapter<T>
java.lang.Object
java.lang.Record
org.empirewar.orbis.serialization.FlagValueAdapter<T>
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<FlagValueParseResult>
public record FlagValueAdapter<T>(RegionFlag<T> flag)
extends Record
implements com.google.gson.JsonDeserializer<FlagValueParseResult>
-
Constructor Summary
ConstructorsConstructorDescriptionFlagValueAdapter(RegionFlag<T> flag) Creates an instance of aFlagValueAdapterrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) final booleanIndicates whether some other object is "equal to" this one.flag()Returns the value of theflagrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FlagValueAdapter
Creates an instance of aFlagValueAdapterrecord class.- Parameters:
flag- the value for theflagrecord component
-
-
Method Details
-
deserialize
public FlagValueParseResult deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException - Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<T>- Throws:
com.google.gson.JsonParseException
-
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). -
flag
Returns the value of theflagrecord component.- Returns:
- the value of the
flagrecord component
-