<commit_before>package org.silverpeas.core.webapi.search;

import org.silverpeas.core.index.search.model.SearchResult;
import org.silverpeas.core.util.StringUtil;

import javax.xml.bind.annotation.XmlElement;
import java.time.LocalDate;

/**
 * @author <NAME>
 */
public class ResultEntity {

  @XmlElement(defaultValue = "")
  private String name;

  @XmlElement(defaultValue = "")
  private String description;

  @XmlElement
  private LocalDate creationDate;

  @XmlElement
  private LocalDate updateDate;

  @XmlElement
  private String type;

  @XmlElement
  private String id;

  @XmlElement
  private String componentId;

  @XmlElement
  private String thumbnailURL;

  public static ResultEntity fromSearchResult(SearchResult gsr) {
    return new ResultEntity(gsr);
  }

  private ResultEntity(SearchResult gsr) {
    this.name = gsr.getName();
    this.description = gsr.getDescription();
    this.creationDate = gsr.getCreationDate();
    this.updateDate = gsr.getLastUpdateDate();
    this.id = gsr.getId();
    this.type = gsr.getType();
    this.componentId = gsr.getInstanceId();
    String thumbnailURL = gsr.getThumbnailURL();
    if (StringUtil.isDefined(thumbnailURL)) {
      this.thumbnailURL = thumbnailURL.replaceFirst("/FileServer/", "/OnlineFileServer/");
    }
  }

  public String getName() {
    return name;
  }

  public void setName(final String name) {
    this.name = name;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(final String description) {
    this.description = description;
  }

  public LocalDate getUpdateDate() {
    return updateDate;
  }

  public LocalDate getCreationDate() {
    return creationDate;
  }

  public String getType() {
    return type;
  }

  public void setType(final String type) {
    this.type = type;
  }
<commit_msg>on feature #3840, using ISO8601 format to represent dates in ResultEntity.java<commit_after>package org.silverpeas.core.webapi.search;

import org.silverpeas.core.index.search.model.SearchResult;
import org.silverpeas.core.util.StringUtil;

import javax.xml.bind.annotation.XmlElement;

/**
 * @author <NAME>
 */
public class ResultEntity {

  @XmlElement(defaultValue = "")
  private String name;

  @XmlElement(defaultValue = "")
  private String description;

  @XmlElement
  private String creationDate;

  @XmlElement
  private String updateDate;

  @XmlElement
  private String type;

  @XmlElement
  private String id;

  @XmlElement
  private String componentId;

  @XmlElement
  private String thumbnailURL;

  public static ResultEntity fromSearchResult(SearchResult gsr) {
    return new ResultEntity(gsr);
  }

  private ResultEntity(SearchResult gsr) {
    this.name = gsr.getName();
    this.description = gsr.getDescription();
    if (gsr.getCreationDate() != null) {
      this.creationDate = gsr.getCreationDate().toString();
    }
    if (gsr.getLastUpdateDate() != null) {
      this.updateDate = gsr.getLastUpdateDate().toString();
    }
    this.id = gsr.getId();
    this.type = gsr.getType();
    this.componentId = gsr.getInstanceId();
    String thumbnailURL = gsr.getThumbnailURL();
    if (StringUtil.isDefined(thumbnailURL)) {
      this.thumbnailURL = thumbnailURL.replaceFirst("/FileServer/", "/OnlineFileServer/");
    }
  }

  public String getName() {
    return name;
  }

  public void setName(final String name) {
    this.name = name;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(final String description) {
    this.description = description;
  }

  public String getUpdateDate() {
    return updateDate;
  }

  public String getCreationDate() {
    return creationDate;
  }

  public String getType() {
    return type;
  }

  public void setType(final String type) {
    this.type = type;
  }

{'fraction_non_alphanumeric': 0.10562091503267974, 'fraction_numerical': 0.0020915032679738564, 'mean_word_length': 3.6207729468599035, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3525097', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1156, 'n_words': 266}