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 be List
genericClass - the generic object class in the key object (if any). i.e. In case of: Map<List<String>, Integer> the value wil be String
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 a ItemType 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 the genericClass record component.
    int hashCode()
    Returns a hash code value for this object.
    java.lang.Class<?> objectClass()
    Returns the value of the objectClass 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 a ItemType record.
      Parameters:
      objectClass - the value for the objectClass record component
      genericClass - the value for the genericClass 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 class java.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 class java.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 with Objects::equals(Object,Object).
      Specified by:
      equals in class java.lang.Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • objectClass

      public java.lang.Class<?> objectClass()
      Returns the value of the objectClass record component.
      Returns:
      the value of the objectClass record component
    • genericClass

      public java.lang.Class<?> genericClass()
      Returns the value of the genericClass record component.
      Returns:
      the value of the genericClass record component