use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily in project lispflowmapping by opendaylight.
the class LispAddressUtil method convertToBinary.
public static Eid convertToBinary(Eid eid) {
Pair<Class<? extends LispAddressFamily>, Address> converted = convertToBinary(eid.getAddress());
if (converted.getRight() == null) {
return eid;
}
EidBuilder eb = new EidBuilder(eid);
eb.setAddressType(converted.getLeft());
eb.setAddress(converted.getRight());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily in project lispflowmapping by opendaylight.
the class LispAddressUtil method convertToBinary.
private static Pair<Class<? extends LispAddressFamily>, Address> convertToBinary(Address addr) {
Address convAddr = null;
Class<? extends LispAddressFamily> convType = null;
if (addr instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) {
convAddr = convertToBinary((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix) addr);
convType = Ipv4PrefixBinaryAfi.class;
} else if (addr instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) {
convAddr = convertToBinary((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) addr);
convType = Ipv6PrefixBinaryAfi.class;
} else if (addr instanceof Ipv4) {
convAddr = convertToBinary((Ipv4) addr);
convType = Ipv4BinaryAfi.class;
} else if (addr instanceof Ipv6) {
convAddr = convertToBinary((Ipv6) addr);
convType = Ipv6BinaryAfi.class;
}
return new ImmutablePair<Class<? extends LispAddressFamily>, Address>(convType, convAddr);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily in project lispflowmapping by opendaylight.
the class LispAddressUtil method convertFromBinary.
public static Eid convertFromBinary(Eid eid) {
Pair<Class<? extends LispAddressFamily>, Address> converted = convertFromBinary(eid.getAddress());
if (converted.getRight() == null) {
return eid;
}
EidBuilder eb = new EidBuilder(eid);
eb.setAddressType(converted.getLeft());
eb.setAddress(converted.getRight());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily in project lispflowmapping by opendaylight.
the class LispAddressUtil method convertFromBinary.
public static Rloc convertFromBinary(Rloc rloc) {
Pair<Class<? extends LispAddressFamily>, Address> converted = convertFromBinary(rloc.getAddress());
if (converted.getRight() == null) {
return rloc;
}
RlocBuilder rb = new RlocBuilder(rloc);
rb.setAddressType(converted.getLeft());
rb.setAddress(converted.getRight());
return rb.build();
}
Aggregations