private static SingleID specsToSpecialInverse ( Specs specs ) { if ( ! specs . source . equalsIgnoreCase ( ANY ) ) { return null ; } String inverseTarget = SPECIAL_INVERSES . get ( new CaseInsensitiveString ( specs . target ) ) ; if ( inverseTarget != null ) { // If the original ID contained "Any-" then make the // special inverse "Any-Foo"; otherwise make it "Foo". // So "Any-NFC" => "Any-NFD" but "NFC" => "NFD". StringBuilder buf = new StringBuilder ( ) ; if ( specs . filter != null ) { buf . append ( specs . filter ) ; } if ( specs . sawSource ) { buf . append ( ANY ) . append ( TARGET_SEP ) ; } buf . append ( inverseTarget ) ; String basicID = ANY + TARGET_SEP + inverseTarget ; if ( specs . variant != null ) { buf . append ( VARIANT_SEP ) . append ( specs . variant ) ; basicID = basicID + VARIANT_SEP + specs . variant ; } return new SingleID ( buf . toString ( ) , basicID ) ; } return null ; }
Given a Specs object return a SingleID representing the special inverse of that ID . If there is no special inverse then return null .