java/webservice/src/main/java/be/bosa/dt/best/webservice/NsConverter.java
/**
	 * Encode/decode a namespace to a short version and vice versa
	 * 
	 * @param id ID to be encoded/decoded
	 * @param map encoding/decoding map
	 * @return ID with shorter or longer namespace
	 */
Encode/decode a namespace to a short version and vice versa

@param id ID to be encoded/decoded
@param map encoding/decoding map
@return ID with shorter or longer namespace
Encode / decode a namespace to a short version and vice versa @param id ID to be encoded / decoded @param map encoding / decoding map @return ID with shorter or longer namespace
private static String encode(String id, String[][] map) {
		if (id == null || id.isBlank()) {
			return id;
		}
		for (int i=0; i<3; i++) {
			if (id.startsWith(map[i][0])) {
				return id.replace(map[i][0], map[i][1]);
			}
		}
		return id;
	}
private static String encode ( String id , String [ ] [ ] map ) { if ( id == null || id . isBlank ( ) ) { return id ; } for ( int i = 0 ; i < 3 ; i ++ ) { if ( id . startsWith ( map [ i ] [ 0 ] ) ) { return id . replace ( map [ i ] [ 0 ] , map [ i ] [ 1 ] ) ; } } return id ; }
Encode/decode a namespace to a short version and vice versa
Encode / decode a namespace to a short version and vice versa