Record Class Location

java.lang.Object
java.lang.Record
io.micronaut.jsonschema.generator.ref.Location
Record Components:
Region - Country region. If set, can not be blank
City - City. If set, can not be blank
Postcode - Postcode. If set, can not be blank
Address - Street address. If set, can not be blank

public record Location(@Pattern(regexp="[A-Z]{2}") @NotNull String Country, String Region, String City, String Postcode, String Address) extends Record
  • Constructor Details

    • Location

      public Location(@Pattern(regexp="[A-Z]{2}") @NotNull @Pattern(regexp="[A-Z]{2}") @NotNull String Country, String Region, String City, String Postcode, String Address)
      Creates an instance of a Location record class.
      Parameters:
      Country - the value for the Country record component
      Region - the value for the Region record component
      City - the value for the City record component
      Postcode - the value for the Postcode record component
      Address - the value for the Address record component
  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • Country

      @Pattern(regexp="[A-Z]{2}") @NotNull public @Pattern(regexp="[A-Z]{2}") @NotNull String Country()
      Returns the value of the Country record component.
      Returns:
      the value of the Country record component
    • Region

      public String Region()
      Returns the value of the Region record component.
      Returns:
      the value of the Region record component
    • City

      public String City()
      Returns the value of the City record component.
      Returns:
      the value of the City record component
    • Postcode

      public String Postcode()
      Returns the value of the Postcode record component.
      Returns:
      the value of the Postcode record component
    • Address

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