Record Class BasicProperty

java.lang.Object
java.lang.Record
org.tudalgo.algoutils.tutor.general.assertions.basic.BasicProperty
Record Components:
key - the key of the property
value - the value of the property
All Implemented Interfaces:
Property

public record BasicProperty(String key, Object value) extends Record implements Property

A basic implementation of a property.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a BasicProperty record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true iff the object is a property with the same key.
    final int
    Returns a hash code value for this object.
    key()
    Returns the value of the key record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

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

    • BasicProperty

      public BasicProperty(String key, Object value)
      Creates an instance of a BasicProperty record class.
      Parameters:
      key - the value for the key record component
      value - the value for the value record component
  • Method Details

    • equals

      public boolean equals(Object o)

      Returns true iff the object is a property with the same key.

      Specified by:
      equals in class Record
      Parameters:
      o - the reference object with which to compare.
      Returns:
      true iff the object is a property with the same key
    • 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
    • key

      public String key()
      Returns the value of the key record component.
      Specified by:
      key in interface Property
      Returns:
      the value of the key record component
    • value

      public Object value()
      Returns the value of the value record component.
      Specified by:
      value in interface Property
      Returns:
      the value of the value record component