code: private Value generatePayload(Key key) {
          Stopwatch tracer = null;
          try {
              String payload;
              switch (key.getEntityType()) {
                  case Application:
                      boolean isRemoteRegionRequested = key.hasRegions();
  
                      if (ALL_APPS.equals(key.getName())) {
                          if (isRemoteRegionRequested) {
                              tracer = serializeAllAppsWithRemoteRegionTimer.start();
                              payload = getPayLoad(key, registry.getApplicationsFromMultipleRegions(key.getRegions()));
                          } else {
                              tracer = serializeAllAppsTimer.start();
                              payload = getPayLoad(key, registry.getApplications());
                          }
                      } else if (ALL_APPS_DELTA.equals(key.getName())) {
                          if (isRemoteRegionRequested) {
                              tracer = serializeDeltaAppsWithRemoteRegionTimer.start();
                              versionDeltaWithRegions.incrementAndGet();
                              versionDeltaWithRegionsLegacy.incrementAndGet();
                              payload = getPayLoad(key,
                                      registry.getApplicationDeltasFromMultipleRegions(key.getRegions()));
                          } else {
                              tracer = serializeDeltaAppsTimer.start();
                              versionDelta.incrementAndGet();
                              versionDeltaLegacy.incrementAndGet();
                              payload = getPayLoad(key, registry.getApplicationDeltas());
                          }
                      } else {
                          tracer = serializeOneApptimer.start();
                          payload = getPayLoad(key, registry.getApplication(key.getName()));
                      }
                      break;
                  case VIP:
                  case SVIP:
                      tracer = serializeViptimer.start();
                      payload = getPayLoad(key, getApplicationsForVip(key, registry));
                      break;
                  default:
                      logger.error("Unidentified entity type: {} found in the cache key.", key.getEntityType());
                      payload = "";
                      break;
              }
              return new Value(payload);
          } finally {
              if (tracer != null) {
                  tracer.stop();
              }
          }
      }
docs: /*
  Generate pay load for the given key.