public static CommunicationMode fromModeNumber(byte modeNumber) {
    switch (modeNumber) {
      case 100:
        return ClientToServer;
      case 101:
        return PrimaryServerToClient;
      case 102:
        return SecondaryServerToClient;
      case 103:
        return GatewayToGateway;
      case 104:
        return MonitorToServer;
      case 105:
        return SuccessfulServerToClient;
      case 106:
        return UnsuccessfulServerToClient;
      case 107:
        return ClientToServerForQueue;
      default:
        throw new IllegalArgumentException("unknown communications mode: " + modeNumber);
    }
  }
check the given mode to see if it is assigned to one of the enumeration's instances
geode-core/src/main/java/org/apache/geode/internal/cache/tier/CommunicationMode.java