Class YangTextSnippet
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.export.YangTextSnippet
-
- All Implemented Interfaces:
Iterable<@NonNull String>
,Immutable
,MutationBehaviour<Immutable>
@Beta @NonNullByDefault({PARAMETER,RETURN_TYPE}) public final class YangTextSnippet extends Object implements Immutable, Iterable<@NonNull String>
A YANG text snippet generated from aDeclaredStatement
. Generatedstream()
oriterator()
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 withisEolString(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isEolString(String str)
Check if an emitted string contains End-Of-Line character.Iterator<@NonNull String>
iterator()
Spliterator<@NonNull String>
spliterator()
Stream<@NonNull String>
stream()
String
toString()
-
-
-
Method Detail
-
spliterator
public Spliterator<@NonNull String> spliterator()
- Specified by:
spliterator
in interfaceIterable<@NonNull String>
-
isEolString
public static boolean isEolString(String str)
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
-
-