private void addError(final ErrorSeverity severity, final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(new RpcErrorImpl(severity, errorType, tag != null ? tag : "operation-failed", message, applicationTag, info, cause)); }
/** * Validate a {@link CanonicalValue} representation. Implementations should override this method if they can * provide a validation algorithm which does not rely on canonical strings but works on representation state only. * * @param value Representation value * @return Validated representation or a {@link CanonicalValueViolation} * @throws NullPointerException if {@code value} is null */ default Variant<T, CanonicalValueViolation> validateRepresentation(final T value) { return validateRepresentation(value, value.toCanonicalString()); }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }
@Override protected String qnameToKey(final QName qname) { if (module.equals(qname.getModule())) { return qname.getLocalName(); } else { return null; } } }
/** * QName Constructor. * * @param namespace * the namespace assigned to the YANG module * @param localName * YANG schema identifier */ private QName(final URI namespace, final String localName) { this(QNameModule.create(namespace), checkLocalName(localName)); }
/** * Validate a {@link DerivedString} representation. Subclasses should override this method if they can * provide a validation algorithm which does not rely on canonical strings but works on representation state only. * * @param value Representation value * @return Validated representation or CanonicalValueViolation * @throws NullPointerException if {@code value} is null */ protected Variant<T, CanonicalValueViolation> validate(final T value) { return validate(value, value.toCanonicalString()); }
public static Uint16 valueOf(final Uint8 uint) { return instanceFor(uint.shortValue()); }
public static Uint64 valueOf(final Uint16 uint) { return instanceFor(uint.intValue()); }
public static Uint32 valueOf(final Uint16 uint) { return instanceFor(uint.intValue()); }
public static Uint64 valueOf(final Uint8 uint) { return instanceFor(uint.shortValue()); }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }
@Override protected String qnameToKey(final QName qname) { if (module.equals(qname.getModule())) { return qname.getLocalName(); } else { return null; } } }
/** * QName Constructor. * * @param namespace * the namespace assigned to the YANG module * @param localName * YANG schema identifier */ private QName(final URI namespace, final String localName) { this(QNameModule.create(namespace), checkLocalName(localName)); }
private void addError(final ErrorSeverity severity, final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(new RpcErrorImpl(severity, errorType, tag != null ? tag : "operation-failed", message, applicationTag, info, cause)); }
/** * Validate a {@link CanonicalValue} representation. Implementations should override this method if they can * provide a validation algorithm which does not rely on canonical strings but works on representation state only. * * @param value Representation value * @return Validated representation or a {@link CanonicalValueViolation} * @throws NullPointerException if {@code value} is null */ default Variant<T, CanonicalValueViolation> validateRepresentation(final T value) { return validateRepresentation(value, value.toCanonicalString()); }
/** * Validate a {@link DerivedString} representation. Subclasses should override this method if they can * provide a validation algorithm which does not rely on canonical strings but works on representation state only. * * @param value Representation value * @return Validated representation or CanonicalValueViolation * @throws NullPointerException if {@code value} is null */ protected Variant<T, CanonicalValueViolation> validate(final T value) { return validate(value, value.toCanonicalString()); }