Verified Owner
Top Description Fields Constructors Methods
org.jabref.model.entry.identifier

public Class RFC

extends EprintIdentifier
Class Inheritance
Imports
java.net.URI, .URISyntaxException, java.util.Optional, java.util.regex.Matcher, .Pattern, org.jspecify.annotations.NonNull

Represents an RFC identifier, which can be used to fetch bibliographic information about the RFC document. This class supports both plain RFC IDs (e.g., "rfc7276") and full URLs (e.g., "https://www.rfc-editor.org/rfc/" + rfc****.html).

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final String
private final String

Constructor Summary

AccessConstructor and Description
public
RFC(@NonNull String
The RFC ID or URL, which will be converted to lowercase and trimmed.
rfcString
)

Constructs an RFC object from a given string.

Method Summary

Modifier and TypeMethod and Description
public String
asString()

Implements org.jabref.model.entry.identifier.Identifier.asString.

Returns the identifier as String

public Optional<URI>

Returns:

An Optional containing the URI if the construction succeeds, otherwise an empty Optional.
getExternalURI
()

Implements org.jabref.model.entry.identifier.Identifier.getExternalURI.

Generates an external URI that points to the RFC document on the rfc-editor website.

public static Optional<RFC>

Returns:

An Optional containing a valid RFC if the input matches the expected pattern, otherwise an empty Optional.
parse
(String
The input string, which could be in the form of an RFC ID (e.g., "rfc1234") or a complete URL.
input
)

Parses the given input string to extract a valid RFC identifier.

Inherited from org.jabref.model.entry.identifier.EprintIdentifier:
getDefaultField

Field Detail

RFC_URL_MATCHback to summary
private static final Pattern RFC_URL_MATCH
RFC_URL_REGEXback to summary
private static final String RFC_URL_REGEX
rfcStringback to summary
private final String rfcString

Constructor Detail

RFCback to summary
public RFC(@NonNull String rfcString)

Constructs an RFC object from a given string.

Parameters
rfcString:@NonNull String

The RFC ID or URL, which will be converted to lowercase and trimmed.

Exceptions
NullPointerException:
if the given rfcString is null.

Method Detail

asStringback to summary
public String asString()

Implements org.jabref.model.entry.identifier.Identifier.asString.

Doc from org.jabref.model.entry.identifier.Identifier.asString.

Returns the identifier as String

Annotations
@Override
getExternalURIback to summary
public Optional<URI> getExternalURI()

Implements org.jabref.model.entry.identifier.Identifier.getExternalURI.

Generates an external URI that points to the RFC document on the rfc-editor website.

Returns:Optional<URI>

An Optional containing the URI if the construction succeeds, otherwise an empty Optional.

Annotations
@Override
parseback to summary
public static Optional<RFC> parse(String input)

Parses the given input string to extract a valid RFC identifier. The input can be a plain RFC ID or a full URL.

Parameters
input:String

The input string, which could be in the form of an RFC ID (e.g., "rfc1234") or a complete URL.

Returns:Optional<RFC>

An Optional containing a valid RFC if the input matches the expected pattern, otherwise an empty Optional.