Testtools should not be bundles
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / SimpleSubsequentAddressFamilyRegistry.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.bgp.parser.impl;
9
10 import org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
12
13 import com.google.common.base.Preconditions;
14
15 public final class SimpleSubsequentAddressFamilyRegistry extends
16 AbstractFamilyRegistry<SubsequentAddressFamily, Integer> implements SubsequentAddressFamilyRegistry {
17         @Override
18         public AutoCloseable registerSubsequentAddressFamily(final Class<? extends SubsequentAddressFamily> clazz, final int number) {
19                 Preconditions.checkArgument(number >= 0 && number <= 255);
20                 return super.registerFamily(clazz, number);
21         }
22
23         @Override
24         public Class<? extends SubsequentAddressFamily> classForFamily(final int number) {
25                 return super.classForFamily(number);
26         }
27
28         @Override
29         public Integer numberForClass(final Class<? extends SubsequentAddressFamily> clazz) {
30                 return super.numberForClass(clazz);
31         }
32 }