<commit_before>/*
 * Copyright (C) 2003-2011 eXo Platform SAS.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.exoplatform.social.client.api.service;

import org.exoplatform.social.client.api.auth.AccessDeniedException;
import org.exoplatform.social.client.api.event.Lifecycle;

/**
 * eXo Social Service.
 *
 * @author <a href="http://hoatle.net">hoatle (hoatlevan at gmail dot com)</a>
 * @since May 19, 2011
 */
public interface Service<M> {

  /**
   * Creates a new instance.
   *
   * @param newInstance new instance
   * @return the created instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M create(M newInstance) throws AccessDeniedException, ServiceException;

  /**
   * Gets an existing instance by its uuid.
   * @param uuid the uuid
   * @return an existing instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M get(String uuid) throws AccessDeniedException, ServiceException;

  /**
   * Updates an existing instance.
   *
   * @param existingInstance
   * @return new updated instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M update(M existingInstance) throws AccessDeniedException, ServiceException;

  /**
   * Deletes an existing instance.
   *
   * @param existingInstance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  void delete(M existingInstance) throws AccessDeniedException, ServiceException;

}<commit_msg>Update Service interface: detele returns deleted instance instead of void<commit_after>/*
 * Copyright (C) 2003-2011 eXo Platform SAS.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.exoplatform.social.client.api.service;

import org.exoplatform.social.client.api.auth.AccessDeniedException;

/**
 * eXo Social Service.
 *
 * @author <a href="http://hoatle.net">hoatle (hoatlevan at gmail dot com)</a>
 * @since May 19, 2011
 */
public interface Service<M> {

  /**
   * Creates a new instance.
   *
   * @param newInstance new instance
   * @return the created instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M create(M newInstance) throws AccessDeniedException, ServiceException;

  /**
   * Gets an existing instance by its uuid.
   * @param uuid the uuid
   * @return an existing instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M get(String uuid) throws AccessDeniedException, ServiceException;

  /**
   * Updates an existing instance.
   *
   * @param existingInstance
   * @return new updated instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M update(M existingInstance) throws AccessDeniedException, ServiceException;

  /**
   * Deletes an existing instance.
   *
   * @param existingInstance
   * @return the deleted instance
   * @throws AccessDeniedException
   * @throws ServiceException
   */
  M delete(M existingInstance) throws AccessDeniedException, ServiceException;

}
{'fraction_non_alphanumeric': 0.08248400094809197, 'fraction_numerical': 0.00711068973690448, 'mean_word_length': 3.720357941834452, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4230950', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1137, 'n_words': 443}