2 * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.mdsal.model.ietf.util.AbstractIetfInetUtil;
14 * A set of utility methods to efficiently instantiate various ietf-inet-types DTOs.
17 public final class IetfInetUtil extends AbstractIetfInetUtil<Ipv4Address, Ipv4Prefix, Ipv6Address, Ipv6Prefix, IpAddress, IpPrefix> {
18 public static final IetfInetUtil INSTANCE = new IetfInetUtil();
20 private IetfInetUtil() {
21 super(Ipv4Address.class, Ipv4Prefix.class, Ipv6Address.class, Ipv6Prefix.class);
25 protected IpAddress ipv4Address(final Ipv4Address addr) {
26 return new IpAddress(addr);
30 protected IpAddress ipv6Address(final Ipv6Address addr) {
31 return new IpAddress(addr);
35 protected IpPrefix ipv4Prefix(Ipv4Prefix addr) {
36 return new IpPrefix(addr);
40 protected IpPrefix ipv6Prefix(Ipv6Prefix addr) {
41 return new IpPrefix(addr);
45 protected String ipv4AddressString(final Ipv4Address addr) {
46 return addr.getValue();
50 protected String ipv6AddressString(final Ipv6Address addr) {
51 return addr.getValue();
55 protected String ipv4PrefixString(final Ipv4Prefix prefix) {
56 return prefix.getValue();
60 protected String ipv6PrefixString(final Ipv6Prefix prefix) {
61 return prefix.getValue();
65 protected Ipv4Address maybeIpv4Address(final IpAddress addr) {
66 return addr.getIpv4Address();
70 protected Ipv6Address maybeIpv6Address(final IpAddress addr) {
71 return addr.getIpv6Address();