- Preconditions.checkNotNull(textChild, "Child node expected, got null for " + getName() + " : " + element);
- Preconditions.checkState(textChild instanceof Text, getName() + " should contain text." +
- Text.class.getName() + " expected, got " + textChild);
+ if (null == textChild){
+ throw new NetconfDocumentedException(String.format( "Child node expected, got null for " + getName() + " : " + element),
+ NetconfDocumentedException.ErrorType.application,
+ NetconfDocumentedException.ErrorTag.invalid_value,
+ NetconfDocumentedException.ErrorSeverity.error);
+ }
+ if (!(textChild instanceof Text)){
+ throw new NetconfDocumentedException(String.format(getName() + " should contain text." +
+ Text.class.getName() + " expected, got " + textChild),
+ NetconfDocumentedException.ErrorType.application,
+ NetconfDocumentedException.ErrorTag.invalid_value,
+ NetconfDocumentedException.ErrorSeverity.error);
+ }