package org.opendaylight.protocol.pcep.spi.pojo;
import com.google.common.base.Preconditions;
-
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.protocol.concepts.HandlerRegistry;
import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
import org.opendaylight.yangtools.yang.binding.DataContainer;
public final class SimpleEROSubobjectRegistry implements EROSubobjectRegistry {
- private final HandlerRegistry<DataContainer, EROSubobjectParser, EROSubobjectSerializer> handlers = new HandlerRegistry<>();
+ private final HandlerRegistry<DataContainer, EROSubobjectParser, EROSubobjectSerializer> handlers =
+ new HandlerRegistry<>();
public AutoCloseable registerSubobjectParser(final int subobjectType, final EROSubobjectParser parser) {
Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= Values.UNSIGNED_SHORT_MAX_VALUE);
}
@Override
- public Subobject parseSubobject(final int type, final ByteBuf buffer, final boolean loose) throws PCEPDeserializerException {
+ public Subobject parseSubobject(final int type, final ByteBuf buffer, final boolean loose)
+ throws PCEPDeserializerException {
Preconditions.checkArgument(type >= 0 && type <= Values.UNSIGNED_SHORT_MAX_VALUE);
final EROSubobjectParser parser = this.handlers.getParser(type);
if (parser == null) {
@Override
public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
- final EROSubobjectSerializer serializer = this.handlers.getSerializer(subobject.getSubobjectType().getImplementedInterface());
+ final EROSubobjectSerializer serializer = this.handlers.getSerializer(
+ subobject.getSubobjectType().getImplementedInterface());
if (serializer == null) {
return;
}