Record Class DtoOptions

java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.codegen.descriptor.field.part.DtoOptions
Record Components:
inDto - whether the field is included in the DTO
inRequest - whether the field is included in the request DTO
inRef - whether the field is included in the reference DTO
responseDtos - names of additional response DTO variants this field participates in

public record DtoOptions(boolean inDto, boolean inRequest, boolean inRef, String[] responseDtos) extends Record
Represents the options for a field regarding Data Transfer Objects (DTOs). This includes whether the field should be included in the DTO, request DTO, and reference DTO.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DtoOptions(boolean inDto, boolean inRequest, boolean inRef, String[] responseDtos)
    Creates an instance of a DtoOptions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the names of additional response DTO variants this field participates in.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the inDto record component.
    boolean
    Returns the value of the inRef record component.
    boolean
    Returns the value of the inRequest record component.
    boolean
    Returns whether the field should be included in the DTO.
    boolean
    Returns whether the field should be included in the reference DTO.
    boolean
    Returns whether the field should be included in the request DTO.
    Returns the value of the responseDtos record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DtoOptions

      public DtoOptions(boolean inDto, boolean inRequest, boolean inRef, String[] responseDtos)
      Creates an instance of a DtoOptions record class.
      Parameters:
      inDto - the value for the inDto record component
      inRequest - the value for the inRequest record component
      inRef - the value for the inRef record component
      responseDtos - the value for the responseDtos record component
  • Method Details

    • isInDto

      public boolean isInDto()
      Returns whether the field should be included in the DTO.
    • isInRequest

      public boolean isInRequest()
      Returns whether the field should be included in the request DTO.
    • isInRef

      public boolean isInRef()
      Returns whether the field should be included in the reference DTO.
    • getResponseDtos

      public String[] getResponseDtos()
      Returns the names of additional response DTO variants this field participates in.
    • 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 '=='.
      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.
    • inDto

      public boolean inDto()
      Returns the value of the inDto record component.
      Returns:
      the value of the inDto record component
    • inRequest

      public boolean inRequest()
      Returns the value of the inRequest record component.
      Returns:
      the value of the inRequest record component
    • inRef

      public boolean inRef()
      Returns the value of the inRef record component.
      Returns:
      the value of the inRef record component
    • responseDtos

      public String[] responseDtos()
      Returns the value of the responseDtos record component.
      Returns:
      the value of the responseDtos record component