Package com.hotels.transformer.model
Record ItemType
java.lang.Object
java.lang.Record
com.hotels.transformer.model.ItemType
- Record Components:
objectClass
- the object class. i.e. In case of:Map<List<String>, Integer>
the value wil beList
genericClass
- the generic object class in the key object (if any). i.e. In case of:Map<List<String>, Integer>
the value wil beString
- All Implemented Interfaces:
MapElemType
public record ItemType(java.lang.Class<?> objectClass, java.lang.Class<?> genericClass) extends java.lang.Record implements MapElemType
Bean class for mapping the "Generic" object type and its nested generic (if any).
-
Constructor Summary
Constructors Constructor Description ItemType(java.lang.Class<?> objectClass, java.lang.Class<?> genericClass)
Creates an instance of aItemType
record. -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.java.lang.Class<?>
genericClass()
Returns the value of thegenericClass
record component.int
hashCode()
Returns a hash code value for this object.java.lang.Class<?>
objectClass()
Returns the value of theobjectClass
record component.java.lang.String
toString()
Returns a string representation of this record.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
ItemType
public ItemType(java.lang.Class<?> objectClass, java.lang.Class<?> genericClass)Creates an instance of aItemType
record.- Parameters:
objectClass
- the value for theobjectClass
record componentgenericClass
- the value for thegenericClass
record component
-
-
Method Details
-
toString
public final java.lang.String toString()Returns a string representation of this record. The representation contains the name of the type, followed by the name and value of each of the record components.- Specified by:
toString
in classjava.lang.Record
- Returns:
- a string representation of this object
-
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.- Specified by:
hashCode
in classjava.lang.Record
- Returns:
- a hash code value for this object
-
equals
public final boolean equals(java.lang.Object o)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 are compared withObjects::equals(Object,Object)
.- Specified by:
equals
in classjava.lang.Record
- Parameters:
o
- the object with which to compare- Returns:
true
if this object is the same as theo
argument;false
otherwise.
-
objectClass
public java.lang.Class<?> objectClass()Returns the value of theobjectClass
record component.- Returns:
- the value of the
objectClass
record component
-
genericClass
public java.lang.Class<?> genericClass()Returns the value of thegenericClass
record component.- Returns:
- the value of the
genericClass
record component
-