code: protected <T extends Dto> T updateObject(Class<T> classOfT, String methodKey, T entity, String entityId, String secondEntityId) throws Exception {
  
          if (entity instanceof EntityBase) {
  
              String urlMethod;
  
              if (secondEntityId.length() > 0) {
                  urlMethod = String.format(this.getRequestUrl(methodKey), entityId, secondEntityId);
              } else if (entityId.length() > 0) {
                  urlMethod = String.format(this.getRequestUrl(methodKey), entityId, ((EntityBase)entity).getId());
              } else {
                  urlMethod = String.format(this.getRequestUrl(methodKey), ((EntityBase)entity).getId());
              }
  
              RestTool rest = new RestTool(this.root, true);
              return rest.request(classOfT, null, urlMethod, this.getRequestType(methodKey), null, null, entity);
          } else {
              return null;
          }
      }
docs: Saves the Dto instance.
  @param <T>               Type on behalf of which the request is being called.
  @param classOfT          Type on behalf of which the request is being called.
  @param methodKey         Relevant method key.
  @param entity            Dto instance that is going to be sent.
  @param entityId          Entity identifier.
  @param secondEntityId    Second entity identifier.
  @return                  The Dto instance returned from API.
  @throws Exception