code: public void setSerializationMethod(SerializationMethod serializationMethod) {
          if (serializationMethod == SerializationMethod.NULL) {
              throw new IllegalArgumentException("Invalid serialization method.");
          }
          
          this.serializationMethod = serializationMethod == null ? SerializationMethod.JSON : serializationMethod;
      }
docs: Sets the serialization method to be used when sending objects.
  
  @param serializationMethod The serialization method.