Class IRKeyword
java.lang.Object
org.opendaylight.yangtools.yang.ir.IRKeyword
- All Implemented Interfaces:
Immutable
- Direct Known Subclasses:
IRKeyword.Qualified
,IRKeyword.Unqualified
@Beta
public abstract sealed class IRKeyword
extends Object
permits IRKeyword.Qualified, IRKeyword.Unqualified
A YANG keyword, as defined, as defined by section 6.1.2 of both
RFC6020 and
RFC7950. The two options are discerned by nullability
of
prefix()
method's return, as hinted by the ABNF for node-identifier
-- and while a keyword is a
semantically different construct, it shares the same value space.
Naming in this class prefers the formal ABNF specification and draws value-space and type-safety implications from that connection, rather than following the RFC-assigned names.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
-
Method Summary
Modifier and TypeMethodDescriptionabstract @NonNull String
Helper method to re-create the string which was used to declared this keyword.final boolean
final int
hashCode()
final @NonNull String
This keyword's 'identifier' part.abstract @Nullable String
prefix()
This keyword's 'prefix' part.final String
toString()
-
Method Details
-
identifier
This keyword's 'identifier' part. This corresponds to what the RFCs refer to asYANG keyword
or aslanguage extension keyword
.Note the returned string is guaranteed to conform to rules of
identifier
ABNF..- Returns:
- This keyword's identifier part.
-
prefix
This keyword's 'prefix' part. This corresponds toprefix identifier
. ForYANG keyword
s this is null. For language extension references this is the non-null prefix which references the YANG module defining the language extension.Note the returned string, if non-null, is guaranteed to conform to rules of
identifier
ABNF.- Returns:
- This keyword's prefix, or null if this keyword references a YANG keyword.
-
asStringDeclaration
Helper method to re-create the string which was used to declared this keyword.- Returns:
- Declaration string.
-
hashCode
public final int hashCode() -
equals
-
toString
-