Package org.loxlylabs.nestedtext
Record Class TypeMappingRules
java.lang.Object
java.lang.Record
org.loxlylabs.nestedtext.TypeMappingRules
- Record Components:
renameFromJava- the Java field we're renaming fromrenameTo- the field we're renaming to in the NestedText outputfieldsToIgnore- fields to ignore when serializingfieldsToIgnoreWhenNull- fields to ignore when serializing if the value is null
public record TypeMappingRules(Map<String,String> renameFromJava, Map<String,String> renameTo, Set<String> fieldsToIgnore, Set<String> fieldsToIgnoreWhenNull)
extends Record
Contains the type level rules for serialization / deserialization.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TypeMappingRules object initializing all fields with empty collections.TypeMappingRules(Map<String, String> renameFromJava, Map<String, String> renameTo, Set<String> fieldsToIgnore, Set<String> fieldsToIgnoreWhenNull) Creates a new TypeMappingRules ensuring all arguments are non-null. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldsToIgnorerecord component.Returns the value of thefieldsToIgnoreWhenNullrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of therenameFromJavarecord component.renameTo()Returns the value of therenameTorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TypeMappingRules
public TypeMappingRules(Map<String, String> renameFromJava, Map<String, String> renameTo, Set<String> fieldsToIgnore, Set<String> fieldsToIgnoreWhenNull) Creates a new TypeMappingRules ensuring all arguments are non-null.- Parameters:
renameFromJava- the Java field we're renaming fromrenameTo- the field we're renaming to in the NestedText outputfieldsToIgnore- fields to ignore when serializingfieldsToIgnoreWhenNull- fields to ignore when serializing if the value is null
-
TypeMappingRules
public TypeMappingRules()Creates a new TypeMappingRules object initializing all fields with empty collections.
-
-
Method Details
-
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). -
renameFromJava
Returns the value of therenameFromJavarecord component.- Returns:
- the value of the
renameFromJavarecord component
-
renameTo
Returns the value of therenameTorecord component.- Returns:
- the value of the
renameTorecord component
-
fieldsToIgnore
Returns the value of thefieldsToIgnorerecord component.- Returns:
- the value of the
fieldsToIgnorerecord component
-
fieldsToIgnoreWhenNull
Returns the value of thefieldsToIgnoreWhenNullrecord component.- Returns:
- the value of the
fieldsToIgnoreWhenNullrecord component
-