floodlight/loxigen — pull request #297 by ronaldchl (2014-07-07 14:06:30+00:00)
Title: Methods to create IPv4Address/IPv6Address from prefix length and other enhancements

Reviewer: @andi-bigswitch

- `IPv4Address.ofCidrMaskLength(int)` and `IPv6Address.ofCidrMaskLength(int)` were the main purposes of this pull request. The logic came from `IPv4AddressWithMask.of(String)` and `IPv6AddressWithMask.of(String)` respectively. Just in case, here's the initial branch which is strictly a subset of this pull request that contains only this change: [ronaldchl/loxigen/ip-mask-convenience-methods](https://github.com/ronaldchl/loxigen/compare/floodlight:master...ip-mask-convenience-methods)
- Deprecated `IPAddress.fromInetAddress(InetAddress)`. Replaced by `IPAddress.of(InetAddress)`.
- Syntactic sugars `IPv4Address.withMask(*)` that correspond to `IPv4Address.of(*)` methods. `IPv6Address` is left out for now (will do if it looks good with `IPv4Address`).
- Added `IPv4Address.of(Inet4Address)` and `IPv6Address.of(Inet6Address)` for the above.
- Deprecated `IPv4AddressWithMask.of(int,int)`. Replaced by `IPv4Address.of(int).withMask(int)`.
- Forcing IPAddress subclasses to override `toString()` and implement `getBytes()`.
- Javadoc consistency updates