code: static Codec<NamingMessage> createFullCodec(final IdentifierFactory factory) {
      final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
          = new HashMap<>();
      clazzToCodecMap.put(NamingLookupRequest.class, new NamingLookupRequestCodec(factory));
      clazzToCodecMap.put(NamingLookupResponse.class, new NamingLookupResponseCodec(factory));
      clazzToCodecMap.put(NamingRegisterRequest.class, new NamingRegisterRequestCodec(factory));
      clazzToCodecMap.put(NamingRegisterResponse.class,
          new NamingRegisterResponseCodec(new NamingRegisterRequestCodec(factory)));
      clazzToCodecMap.put(NamingUnregisterRequest.class, new NamingUnregisterRequestCodec(factory));
      final Codec<NamingMessage> codec = new MultiCodec<>(clazzToCodecMap);
      return codec;
    }
docs: Creates a codec for both lookup and registration.
  
  @param factory an identifier factory
  @return a codec