Esempio n. 1
0
  private static Entry infoToPlasmidForField(Entry entry, String value, EntryField field) {
    if (!entry.getRecordType().equalsIgnoreCase(EntryType.PLASMID.toString())) return entry;

    Plasmid plasmid = (Plasmid) entry;

    switch (field) {
      case BACKBONE:
        plasmid.setBackbone(value);
        return plasmid;

      case PROMOTERS:
        plasmid.setPromoters(value);
        return plasmid;

      case REPLICATES_IN:
        plasmid.setReplicatesIn(value);
        return plasmid;

      case CIRCULAR:
        plasmid.setCircular(
            "yes".equalsIgnoreCase(value)
                || "true".equalsIgnoreCase(value)
                || "circular".equalsIgnoreCase(value));
        return plasmid;

      case ORIGIN_OF_REPLICATION:
        plasmid.setOriginOfReplication(value);
        return plasmid;

      default:
        return plasmid;
    }
  }
Esempio n. 2
0
  protected static Entry setPlasmidFields(PlasmidData plasmidData, Entry entry) {
    if (plasmidData == null) return entry;

    Plasmid plasmid = (Plasmid) entry;

    if (plasmidData.getBackbone() != null) plasmid.setBackbone(plasmidData.getBackbone());

    if (plasmidData.getOriginOfReplication() != null)
      plasmid.setOriginOfReplication(plasmidData.getOriginOfReplication());

    if (plasmidData.getPromoters() != null) plasmid.setPromoters(plasmidData.getPromoters());

    if (plasmidData.getReplicatesIn() != null)
      plasmid.setReplicatesIn(plasmidData.getReplicatesIn());

    if (plasmidData.getCircular() != null) plasmid.setCircular(plasmidData.getCircular());

    return entry;
  }