2 * Copyright (c) 2015 Yale University 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
9 package org.opendaylight.alto.commons.types.converter;
11 import java.util.List;
12 import java.util.LinkedList;
14 import org.opendaylight.alto.commons.helper.Converter;
15 import org.opendaylight.alto.commons.types.rfc7285.RFC7285Endpoint;
16 import org.opendaylight.alto.commons.types.model150404.ModelEndpointAddressGroup;
18 public class RFC2ModelEndpointAddressGroupConverter
19 extends Converter<RFC7285Endpoint.AddressGroup, List<ModelEndpointAddressGroup>> {
21 public RFC2ModelEndpointAddressGroupConverter() {
24 public RFC2ModelEndpointAddressGroupConverter(RFC7285Endpoint.AddressGroup _in) {
29 protected Object _convert() {
30 List<ModelEndpointAddressGroup> out = new LinkedList<ModelEndpointAddressGroup>();
31 if ((in().ipv4 != null) && (!in().ipv4.isEmpty())) {
32 ModelEndpointAddressGroup v4 = new ModelEndpointAddressGroup();
33 v4.type = ModelEndpointAddressGroup.IPV4;
34 v4.prefixes = in().ipv4;
37 if ((in().ipv6 != null) && (!in().ipv6.isEmpty())) {
38 ModelEndpointAddressGroup v6 = new ModelEndpointAddressGroup();
39 v6.type = ModelEndpointAddressGroup.IPV6;
40 v6.prefixes = in().ipv6;