Record Class Materiale

java.lang.Object
java.lang.Record
it.uniupo.simnova.domain.common.Materiale
Record Components:
idMateriale - l'identificativo univoco del materiale
nome - il nome del materiale
descrizione - una descrizione del materiale

public record Materiale(int idMateriale, String nome, String descrizione) extends Record
Rappresenta un materiale con un identificativo univoco, un nome e una descrizione.
  • Constructor Details

    • Materiale

      public Materiale(int idMateriale, String nome, String descrizione)
      Creates an instance of a Materiale record class.
      Parameters:
      idMateriale - the value for the idMateriale record component
      nome - the value for the nome record component
      descrizione - the value for the descrizione record component
  • Method Details

    • getId

      public Integer getId()
      Restituisce l'identificativo univoco del materiale come Integer. Questo รจ un metodo accessore personalizzato che sovrascrive il comportamento predefinito del record (che altrimenti restituirebbe un 'int' per 'idMateriale()').
      Returns:
      L'ID del materiale come Integer.
    • toString

      public final String 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.
      Specified by:
      toString in class 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 Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • idMateriale

      public int idMateriale()
      Returns the value of the idMateriale record component.
      Returns:
      the value of the idMateriale record component
    • nome

      public String nome()
      Returns the value of the nome record component.
      Returns:
      the value of the nome record component
    • descrizione

      public String descrizione()
      Returns the value of the descrizione record component.
      Returns:
      the value of the descrizione record component