Record Class DatabaseManager.StructureInsertResult

java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.managers.DatabaseManager.StructureInsertResult
Record Components:
structure - The structure as it was inserted into the database. This will be empty when inserted failed.
cancelled - Whether the insertion was cancelled. An insertion may be cancelled if some listener cancels the IStructurePrepareCreateEvent event.
Enclosing class:
DatabaseManager

public static record DatabaseManager.StructureInsertResult(Optional<Structure> structure, boolean cancelled) extends Record
Contains the result of an attempt to insert a structure into the database.
  • Constructor Details

    • StructureInsertResult

      public StructureInsertResult(Optional<Structure> structure, boolean cancelled)
      Creates an instance of a StructureInsertResult record class.
      Parameters:
      structure - the value for the structure record component
      cancelled - the value for the cancelled 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. 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.
    • structure

      public Optional<Structure> structure()
      Returns the value of the structure record component.
      Returns:
      the value of the structure record component
    • cancelled

      public boolean cancelled()
      Returns the value of the cancelled record component.
      Returns:
      the value of the cancelled record component