<commit_before>/**
 * Entity representing the PDC record structure in storage.
 * TODO apply TDA (tell don't ask) principle to getter methods.
 */
package de.ddb.pdc.storage;

import de.ddb.pdc.core.AnsweredQuestion;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import org.springframework.data.annotation.Id;

public class StorageModel {

  @Id
  private String id;

  private final String itemId;
  private final String itemCategory;
  private final String institute;
  private final boolean publicDomain;
  private final List<AnsweredQuestion> trace;
  private final String timestamp;

  /**
   * Constructor for the repository.
   * @param itemId
   * @param itemCategory
   * @param institute
   * @param publicDomain
   * @param trace
   * @param timestamp as a String, in U
   */
  public StorageModel(String itemId, String itemCategory, String institute,
      boolean publicDomain, List<AnsweredQuestion> trace, String timestamp) {

    this.itemId = itemId;
    this.itemCategory = itemCategory;
    this.institute = institute;
    this.publicDomain = publicDomain;
    this.trace = trace;
    this.timestamp = timestamp;
  }

  /**
   * Constructor for storing new records.
   * The timestamp is automatically assigned to the current date and time.
   * 
   * TODO move the SimpleDateFormat initialization elsewhere
   * TODO set the time zone through the properties file
   * 
   * @param itemId
   * @param itemCategory
   * @param institute
   * @param publicDomain
   * @param trace
   */
  public StorageModel(String itemId, String itemCategory, String institute,
          boolean publicDomain, List<AnsweredQuestion> trace) {

    this.itemId = itemId;
    this.itemCategory = itemCategory;
    this.institute = institute;
    this.publicDomain = publicDomain;
    this.trace = trace;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
    this.timestamp = sdf.format(new Date());
  }
  
  
  /**
   * 
   * @return 
   */
  public String getItemId() {
    return itemId;
  }

  /**
   * 
   * @return 
   */
  public String getItemCategory() {
    return itemCategory;
  }

  /**
   * 
   * @return 
   */
  public String getInstitute() {
    return institute;
  }

  /**
   * 
   * @return 
   */
  public boolean isPublicDomain() {
    return publicDomain;
  }

  /**
   * 
   * @return 
   */
  public List<AnsweredQuestion> getTrace() {
    return trace;
  }

  /**
   * 
   * @return 
   */
  public String getTimestampAsString() {
    return timestamp;
  }

}<commit_msg>Delete second constructor (not needed any more)<commit_after>/**
 * Entity representing the PDC record structure in storage.
 * TODO apply TDA (tell don't ask) principle to getter methods.
 */
package de.ddb.pdc.storage;

import de.ddb.pdc.core.AnsweredQuestion;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import org.springframework.data.annotation.Id;

public class StorageModel {

  @Id
  private String id;

  private final String itemId;
  private final String itemCategory;
  private final String institute;
  private final boolean publicDomain;
  private final List<AnsweredQuestion> trace;
  private final String timestamp;

  /**
   * Constructor for storing new records.
   * The timestamp is automatically assigned to the current date and time.
   *
   * TODO move the SimpleDateFormat initialization elsewhere
   * TODO set the time zone through the properties file
   *
   * @param itemId
   * @param itemCategory
   * @param institute
   * @param publicDomain
   * @param trace
   */
  public StorageModel(String itemId, String itemCategory, String institute,
          boolean publicDomain, List<AnsweredQuestion> trace) {

    this.itemId = itemId;
    this.itemCategory = itemCategory;
    this.institute = institute;
    this.publicDomain = publicDomain;
    this.trace = trace;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
    this.timestamp = sdf.format(new Date());
  }


  /**
   *
   * @return
   */
  public String getItemId() {
    return itemId;
  }

  /**
   *
   * @return
   */
  public String getItemCategory() {
    return itemCategory;
  }

  /**
   *
   * @return
   */
  public String getInstitute() {
    return institute;
  }

  /**
   *
   * @return
   */
  public boolean isPublicDomain() {
    return publicDomain;
  }

  /**
   *
   * @return
   */
  public List<AnsweredQuestion> getTrace() {
    return trace;
  }

  /**
   *
   * @return
   */
  public String getTimestampAsString() {
    return timestamp;
  }

}
{'fraction_non_alphanumeric': 0.09881506559458315, 'fraction_numerical': 0.0, 'mean_word_length': 2.9823083403538333, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7096', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1396, 'n_words': 394}