Class IRArgument.Single
java.lang.Object
org.opendaylight.yangtools.yang.ir.IRArgument
org.opendaylight.yangtools.yang.ir.IRArgument.Single
- All Implemented Interfaces:
Immutable
- Enclosing class:
- IRArgument
An argument composed of a single string. This string may need further validation and processing, as it may not
actually conform to the specification as requested by
yang-version
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.ir.IRArgument
IRArgument.Concatenation, IRArgument.Single
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final int
hashCode()
final boolean
Imprecise check if this argument complies with theidentifier
YANG specification.final boolean
Imprecise check if this argument needs an additional content check for compliance.final boolean
Imprecise check if this argument needs further unescape operation (which is version-specific) to arrive at the literal string value.final @NonNull String
string()
Significant portion of this argument.final String
toString()
Methods inherited from class org.opendaylight.yangtools.yang.ir.IRArgument
doubleQuoted, empty, identifier, of, singleQuoted, unquoted
-
Method Details
-
string
Significant portion of this argument. For unquoted and single-quoted strings this is the unquoted string literal. For double-quoted strings this is the unquoted string, after whitespace trimming as defined by RFC6020/RFC7950 section 6.1.3, but before escape substitution.- Returns:
- Significant portion of this argument.
-
needUnescape
public final boolean needUnescape()Imprecise check if this argument needs further unescape operation (which is version-specific) to arrive at the literal string value. This is false for unquoted and single-quoted strings, which do not support any sort of escaping. This may be true for double-quoted strings, as they may need to be further processed in version-dependent ways to arrive at the correct literal value.This method is allowed to err on the false-positive side -- i.e. it may report any double-quoted string as needing further processing, even when the actual content could be determined to not need further processing.
- Returns:
- False if the value of
string
can be used as-is.
-
needQuoteCheck
public final boolean needQuoteCheck()Imprecise check if this argument needs an additional content check for compliance. This is false if the string was explicitly quoted and therefore cannot contain stray single- or double-quotes, or if the content has already been checked to not contain them.The content check is needed to ascertain RFC7950 compliance, because RFC6020 allows constructs like
abc"def
in unquoted strings, while RFC7950 explicitly forbids them.This method is allowed to err on the false-positive side -- i.e. it may report any unquoted string as needing this check, even when the actual content could be determined to not contain quotes.
- Returns:
- True if this argument requires a version-specific check for quote content.
-
isValidIdentifier
public final boolean isValidIdentifier()Imprecise check if this argument complies with theidentifier
YANG specification.This method is allowed to err on the false-negative side -- i.e. it may report any string as not being compliant with
identifier
, even when the actual content could be determined to be compliant.- Returns:
- True if this argument is known to be directly usable in contexts where YANG requires the use of
-
hashCode
public final int hashCode() -
equals
-
toString
-