Record Class ChangelogResult

java.lang.Object
java.lang.Record
com.palmergames.bukkit.towny.object.ChangelogResult
Record Components:
lines - The changelog lines, will be empty if the changelog could not be read successfully.
successful - Whether the changelog file was read successfully, currently only false if the last version could not be found.
limitReached - Whether the specified line limit was reached during reading.
nextVersionIndex - The line index of where the first version changelog for the first version after the last version starts.
totalSize - The total line count of the changelog.

public record ChangelogResult(Collection<String> lines, boolean successful, boolean limitReached, int nextVersionIndex, int totalSize) extends Record
Represents a read changelog from a ChangelogReader.
  • Constructor Details

    • ChangelogResult

      public ChangelogResult(Collection<String> lines, boolean successful, boolean limitReached, int nextVersionIndex, int totalSize)
      Creates an instance of a ChangelogResult record class.
      Parameters:
      lines - the value for the lines record component
      successful - the value for the successful record component
      limitReached - the value for the limitReached record component
      nextVersionIndex - the value for the nextVersionIndex record component
      totalSize - the value for the totalSize 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 '=='.
      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.
    • lines

      public Collection<String> lines()
      Returns the value of the lines record component.
      Returns:
      the value of the lines record component
    • successful

      public boolean successful()
      Returns the value of the successful record component.
      Returns:
      the value of the successful record component
    • limitReached

      public boolean limitReached()
      Returns the value of the limitReached record component.
      Returns:
      the value of the limitReached record component
    • nextVersionIndex

      public int nextVersionIndex()
      Returns the value of the nextVersionIndex record component.
      Returns:
      the value of the nextVersionIndex record component
    • totalSize

      public int totalSize()
      Returns the value of the totalSize record component.
      Returns:
      the value of the totalSize record component