Record Class Postal

java.lang.Object
java.lang.Record
com.maxmind.geoip2.record.Postal
Record Components:
code - The postal code of the location. Postal codes are not available for all countries. In some countries, this will only contain part of the postal code.
confidence - A value from 0-100 indicating MaxMind's confidence that the postal code is correct. This attribute is only available from the Insights web service and the GeoIP2 Enterprise database.
All Implemented Interfaces:
JsonSerializable

public record Postal(String code, Integer confidence) extends Record implements JsonSerializable

Contains data for the postal record associated with an IP address.

  • Constructor Details

    • Postal

      public Postal()
      Constructs a Postal record.
    • Postal

      public Postal(String code, Integer confidence)
      Creates an instance of a Postal record class.
      Parameters:
      code - the value for the code record component
      confidence - the value for the confidence record component
  • Method Details

    • getCode

      @Deprecated(since="5.0.0", forRemoval=true) public String getCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use code() instead. This method will be removed in 6.0.0.
      Returns:
      The postal code of the location. Postal codes are not available for all countries. In some countries, this will only contain part of the postal code.
    • getConfidence

      @Deprecated(since="5.0.0", forRemoval=true) public Integer getConfidence()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use confidence() instead. This method will be removed in 6.0.0.
      Returns:
      A value from 0-100 indicating MaxMind's confidence that the postal code is correct. This attribute is only available from the Insights web service and the GeoIP2 Enterprise database.
    • 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.
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • confidence

      public Integer confidence()
      Returns the value of the confidence record component.
      Returns:
      the value of the confidence record component