Package org.plumelib.util
Record Class EntryReader.Entry
java.lang.Object
java.lang.Record
org.plumelib.util.EntryReader.Entry
- Record Components:
firstLine- first line of the entrybody- complete body of the entry including the first linefilename- filename in which the entry was foundlineNumber- line number of first line of entryshortEntry- true if this is a short entry (blank-line-separated)
- Enclosing class:
EntryReader
public static record EntryReader.Entry(String firstLine, String body, String filename, long lineNumber, boolean shortEntry)
extends Record
Descriptor for an entry (record, paragraph, etc.).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.filename()Returns the value of thefilenamerecord component.Returns the value of thefirstLinerecord component.getDescription(@Nullable Pattern re) Returns a substring of the entry body that matches the specified regular expression.final inthashCode()Returns a hash code value for this object.longReturns the value of thelineNumberrecord component.booleanReturns the value of theshortEntryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Entry
Creates an instance of aEntryrecord class.- Parameters:
firstLine- the value for thefirstLinerecord componentbody- the value for thebodyrecord componentfilename- the value for thefilenamerecord componentlineNumber- the value for thelineNumberrecord componentshortEntry- the value for theshortEntryrecord component
-
-
Method Details
-
getDescription
Returns a substring of the entry body that matches the specified regular expression. If no match is found, returnsfirstLine.- Parameters:
re- regex to match- Returns:
- a substring that matches re
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
firstLine
Returns the value of thefirstLinerecord component.- Returns:
- the value of the
firstLinerecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
filename
Returns the value of thefilenamerecord component.- Returns:
- the value of the
filenamerecord component
-
lineNumber
public long lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
shortEntry
public boolean shortEntry()Returns the value of theshortEntryrecord component.- Returns:
- the value of the
shortEntryrecord component
-