Package org.microproxy.warc
Record Class WarcReader.Record
java.lang.Object
java.lang.Record
org.microproxy.warc.WarcReader.Record
- Record Components:
version- the version, such asWARC/1.1fields- the named fields, in orderblock- the record's content block
- Enclosing class:
WarcReader
public static record WarcReader.Record(String version, List<Map.Entry<String,String>> fields, byte[] block)
extends Record
One WARC record: its version line, named fields and block.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]block()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.The first value of a named field, compared without regard to case.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the record id (WARC-Record-ID), or null.final StringtoString()Returns a string representation of this record class.type()Returns the record type (WARC-Type), such asresponse; empty if missing.version()Returns the value of theversionrecord component.
-
Constructor Details
-
Record
Copies the fields.
-
-
Method Details
-
field
The first value of a named field, compared without regard to case.- Parameters:
name- the field name, such asWARC-Target-URI- Returns:
- the value, or null if the record has no such field
-
type
Returns the record type (WARC-Type), such asresponse; empty if missing.- Returns:
- the record type (
WARC-Type), such asresponse; empty if missing
-
id
Returns the record id (WARC-Record-ID), or null.- Returns:
- the record id (
WARC-Record-ID), or null
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
block
public byte[] block()Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-