public String convertToPrefixLength ( ) throws AddressStringException { IPAddress address = toAddress ( ) ; Integer prefix ; if ( address == null ) { if ( isPrefixOnly ( ) ) { prefix = getNetworkPrefixLength ( ) ; } else { return null ; } } else { prefix = address . getBlockMaskPrefixLength ( true ) ; if ( prefix == null ) { return null ; } } return IPAddressSegment . toUnsignedString ( prefix , 10 , new StringBuilder ( IPAddressSegment . toUnsignedStringLength ( prefix , 10 ) + 1 ) . append ( IPAddress . PREFIX_LEN_SEPARATOR ) ) . toString ( ) ; }
Converts this address to a prefix length