<commit_before>package de.cs.fau.mad.quickshop.android.common;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "unit")
public class Unit {

  @DatabaseField(generatedId = true)
  private int id;

  @DatabaseField(canBeNull = false)
  private String name;

  public Unit(){
      // Default no-arg constructor for generating Units, required for ORMLite
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

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


  @Override
  public int hashCode() {
    return id;
  }

  @Override
  public boolean equals(Object other) {

    if (other == null) {
      return false;
    }

    if (!(other instanceof Unit)) {
      return false;
    }

    Unit otherUnit = (Unit) other;
    return otherUnit.getId() == this.getId() &&
            otherUnit.getName().equals(this.getName());
  }

}
<commit_msg>Made Unit class localizable by also storing resource names for localized names. The name property is now intended to be language-neutral;<commit_after>package de.cs.fau.mad.quickshop.android.common;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "unit")
public class Unit {

  @DatabaseField(generatedId = true)
  private int id;

  @DatabaseField(canBeNull = false)
  //language-neutral name of the unit (= english)
  private String name;

  @DatabaseField(canBeNull = true)
  // the name of the string resource for the localized name of the unit
  private String displayNameResourceName;

  @DatabaseField(canBeNull = true)
  //the name of the string resource for the localized short name of the unit
  private String shortDisplayNameResourceName;

  public Unit(){
      // Default no-arg constructor for generating Units, required for ORMLite
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }


  public String getName() {
    return this.name;
  }

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

  public String getDisplayNameResourceName() {
    return displayNameResourceName;
  }

  public void setDisplayNameResourceName(String value) {
    this.displayNameResourceName = value;
  }

  public String getShortDisplayNameResourceName() {
    return shortDisplayNameResourceName;
  }

  public void setShortDisplayNameResourceName(String value) {
    this.shortDisplayNameResourceName = value;
  }


  @Override
  public int hashCode() {
    return id;
  }

  @Override
  public boolean equals(Object other) {

    if (other == null) {
      return false;
    }

    if (!(other instanceof Unit)) {
      return false;
    }

    return equals((Unit) other);

  }


  public boolean equals(Unit other) {
    return other.getId() == this.getId() && other.getName().equals(this.getName());
  }


}

{'fraction_non_alphanumeric': 0.09878624409979771, 'fraction_numerical': 0.004045853000674309, 'mean_word_length': 3.244635193133047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6720508', 'n_tokens_mistral': 932, 'n_tokens_neox': 876, 'n_words': 256}