@ Override public String address ( Class < ? > api , String address ) { Objects . requireNonNull ( address ) ; if ( address . isEmpty ( ) ) { address = addressDefault ( api ) ; } int slash = address . indexOf ( "/" ) ; //int colon = address.indexOf(":"); if ( address . endsWith ( ":" ) && slash < 0 ) { address += "//" ; } int p = address . indexOf ( "://" ) ; int q = - 1 ; if ( p > 0 ) { q = address . indexOf ( ' ' , p + 3 ) ; } if ( address . indexOf ( ' ' ) > 0 ) { return addressBraces ( api , address ) ; } boolean isPrefix = address . startsWith ( "session:" ) || address . startsWith ( "pod:" ) ; if ( address . isEmpty ( ) || p > 0 && q < 0 && isPrefix ) { if ( Vault . class . isAssignableFrom ( api ) ) { TypeRef itemRef = TypeRef . of ( api ) . to ( Vault . class ) . param ( "T" ) ; Class < ? > assetClass = itemRef . rawClass ( ) ; address = address + "/" + apiAddress ( assetClass ) ; } else { address = address + "/" + apiAddress ( api ) ; } } return address ; }
Calculate address from an API with an address default