There is no point having these protected, just make them
package-private.
While we are here, also centralize implementations, as otherwise we have
duplicates.
JIRA: MDSAL-815
Change-Id: I7d708c5d508f49fb8c3224463d8c36fd9cf5e021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
- protected Object deserializeObject(final NormalizedNode normalizedNode) {
+ Object deserializeObject(final NormalizedNode normalizedNode) {
return filterFrom(checkDataArgument(DataContainerNode.class, normalizedNode));
}
return filterFrom(checkDataArgument(DataContainerNode.class, normalizedNode));
}
- protected NodeIdentifier getDomPathArgument() {
+ NodeIdentifier getDomPathArgument() {
return createBindingProxy(checkDataArgument(ChoiceNode.class, data));
}
return createBindingProxy(checkDataArgument(ChoiceNode.class, data));
}
- @Override
- protected Object deserializeObject(final NormalizedNode normalizedNode) {
- return deserialize(normalizedNode);
- }
-
@Override
public PathArgument serializePathArgument(final DataObjectStep<?> step) {
if (step != null) {
@Override
public PathArgument serializePathArgument(final DataObjectStep<?> step) {
if (step != null) {
- protected T deserializeObject(final NormalizedNode normalizedNode) {
+ T deserializeObject(final NormalizedNode normalizedNode) {
final var casted = checkDataArgument(ChoiceNode.class, normalizedNode);
final var it = casted.body().iterator();
if (!it.hasNext()) {
final var casted = checkDataArgument(ChoiceNode.class, normalizedNode);
final var it = casted.body().iterator();
if (!it.hasNext()) {
*
* @return NodeIdentifier of node, or {@code null} if not applicable
*/
*
* @return NodeIdentifier of node, or {@code null} if not applicable
*/
- protected abstract @Nullable NodeIdentifier getDomPathArgument();
+ abstract @Nullable NodeIdentifier getDomPathArgument();
/**
* Return the default value object. Implementations of this method are explicitly allowed to throw unchecked
/**
* Return the default value object. Implementations of this method are explicitly allowed to throw unchecked
- protected abstract Object deserializeObject(NormalizedNode normalizedNode);
+ abstract Object deserializeObject(NormalizedNode normalizedNode);
public final D deserialize(final NormalizedNode data) {
return createBindingProxy(checkDataArgument(ContainerNode.class, data));
}
public final D deserialize(final NormalizedNode data) {
return createBindingProxy(checkDataArgument(ContainerNode.class, data));
}
-
- @Override
- protected final Object deserializeObject(final NormalizedNode normalizedNode) {
- return deserialize(normalizedNode);
- }
// overridden in AugmentationCodecContext
@Override
// overridden in AugmentationCodecContext
@Override
- protected NodeIdentifier getDomPathArgument() {
+ NodeIdentifier getDomPathArgument() {
return prototype.yangArg();
}
return prototype.yangArg();
}
throw new IllegalStateException(e);
}
}
throw new IllegalStateException(e);
}
}
+
+ @Override
+ Object deserializeObject(final NormalizedNode normalizedNode) {
+ return deserialize(normalizedNode);
+ }
- protected Object deserializeObject(final NormalizedNode node) {
+ Object deserializeObject(final NormalizedNode node) {
if (node instanceof MapNode map) {
return fromMap(map);
} else if (node instanceof MapEntryNode mapEntry) {
if (node instanceof MapNode map) {
return fromMap(map);
} else if (node instanceof MapEntryNode mapEntry) {
return verifyNotNull(ret);
}
return verifyNotNull(ret);
}
- @Override
- protected Object deserializeObject(final NormalizedNode normalizedNode) {
- return deserialize(normalizedNode);
- }
-
/**
* Prototype for a {@code notification}. This class only exists because DataContainerCodecContext requires a
* prototype.
/**
* Prototype for a {@code notification}. This class only exists because DataContainerCodecContext requires a
* prototype.
}
private final @NonNull NodeIdentifier yangIdentifier;
}
private final @NonNull NodeIdentifier yangIdentifier;
+ private final @NonNull DataSchemaNode dataSchema;
private final @NonNull String getterName;
private final @NonNull String getterName;
- private final @NonNull DataSchemaNode schema;
private final Object defaultObject;
private final Object defaultObject;
- ValueNodeCodecContext(final DataSchemaNode schema, final String getterName, final Object defaultObject) {
- yangIdentifier = NodeIdentifier.create(schema.getQName());
+ ValueNodeCodecContext(final DataSchemaNode dataSchema, final String getterName, final Object defaultObject) {
this.getterName = requireNonNull(getterName);
this.getterName = requireNonNull(getterName);
- this.schema = requireNonNull(schema);
+ this.dataSchema = requireNonNull(dataSchema);
+ yangIdentifier = NodeIdentifier.create(dataSchema.getQName());
this.defaultObject = defaultObject;
}
@Override
this.defaultObject = defaultObject;
}
@Override
- protected final NodeIdentifier getDomPathArgument() {
+ final NodeIdentifier getDomPathArgument() {
@Override
public final DataSchemaNode getSchema() {
@Override
public final DataSchemaNode getSchema() {