Class YangTextSnippet
java.lang.Object
org.opendaylight.yangtools.yang.model.export.YangTextSnippet
@NonNullByDefault({PARAMETER,RETURN_TYPE})
public final class YangTextSnippet
extends Object
implements Immutable, Iterable<@NonNull String>
A YANG text snippet generated from a
DeclaredStatement
. Generated stream()
or iterator()
are guaranteed to not contain null nor empty strings. Furthermore, newlines are always emitted at the end
on the generated string -- which can be checked with isEolString(String)
utility method.
This allows individual strings to be escaped as needed and external indentation can be accounted for by inserting
outer document indentation after the string which matched isEolString(String)
is emitted to the stream.
- Author:
- Robert Varga
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isEolString
(String str) Check if an emitted string contains End-Of-Line character.iterator()
Spliterator<@NonNull String>
stream()
toString()
-
Method Details
-
iterator
-
spliterator
- Specified by:
spliterator
in interfaceIterable<@NonNull String>
-
stream
-
isEolString
Check if an emitted string contains End-Of-Line character.- Parameters:
str
- String to be checked- Returns:
- True if the string contains end of line.
- Throws:
NullPointerException
- if str is null
-
toString
-