Class LogRecord

java.lang.Object
com.logviewer.data2.LogRecord
All Implemented Interfaces:
Externalizable, Serializable, Comparable<LogRecord>

public class LogRecord extends Object implements Comparable<LogRecord>, Externalizable
See Also:
  • Field Details

    • WHOLE_LINE

      public static final String WHOLE_LINE
      The name of generic field that contains whole record text.
      See Also:
  • Constructor Details

    • LogRecord

      public LogRecord()
      Used by deserializer only.
    • LogRecord

      public LogRecord(@NonNull String message, long timeNanos, long start, long end, int loadedTextLengthBytes)
    • LogRecord

      public LogRecord(@NonNull String message, long timeNanos, long start, long end, int loadedTextLengthBytes, @NonNull int[] fieldPositions, @NonNull Map<String,Integer> fieldNames)
  • Method Details

    • getLogId

      public String getLogId()
    • setLogId

      public LogRecord setLogId(String logId)
    • getStart

      public long getStart()
    • getEnd

      public long getEnd()
    • hasMore

      public boolean hasMore()
    • getLoadedTextLengthBytes

      public int getLoadedTextLengthBytes()
    • getTime

      public long getTime()
    • getTimeMillis

      public long getTimeMillis()
    • hasTime

      public boolean hasTime()
    • getMessage

      public String getMessage()
    • getFieldOffset

      public TextRange getFieldOffset(String fieldName)
    • getFieldText

      public String getFieldText(String fieldName)
    • getFieldNames

      public Set<String> getFieldNames()
    • getFieldPositions

      public int[] getFieldPositions()
      An array containing field positions. The start offset of a field with index "i" is located in getFieldPositions()[i * 2], the end is in getFieldPositions()[i * 2 + 1]
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(LogRecord o)
      Specified by:
      compareTo in interface Comparable<LogRecord>
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • createUnparsedRecord

      @NonNull public static LogRecord createUnparsedRecord(@NonNull String message, long time, long start, long end, int loadedTextLengthBytes)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object