All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindee.product.resume.ResumeV1ProfessionalExperience Maven / Gradle / Ivy

The newest version!
package com.mindee.product.resume;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mindee.parsing.SummaryHelper;
import com.mindee.parsing.standard.BaseField;
import com.mindee.parsing.standard.LineItemField;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;

/**
 * The list of the candidate's professional experiences.
 */
@Getter
@JsonIgnoreProperties(ignoreUnknown = true)
public class ResumeV1ProfessionalExperience extends BaseField implements LineItemField {

  /**
   * The type of contract for the professional experience.
   */
  @JsonProperty("contract_type")
  String contractType;
  /**
   * The specific department or division within the company.
   */
  @JsonProperty("department")
  String department;
  /**
   * The description of the professional experience as written in the document.
   */
  @JsonProperty("description")
  String description;
  /**
   * The name of the company or organization.
   */
  @JsonProperty("employer")
  String employer;
  /**
   * The month when the professional experience ended.
   */
  @JsonProperty("end_month")
  String endMonth;
  /**
   * The year when the professional experience ended.
   */
  @JsonProperty("end_year")
  String endYear;
  /**
   * The position or job title held by the candidate.
   */
  @JsonProperty("role")
  String role;
  /**
   * The month when the professional experience began.
   */
  @JsonProperty("start_month")
  String startMonth;
  /**
   * The year when the professional experience began.
   */
  @JsonProperty("start_year")
  String startYear;

  public boolean isEmpty() {
    return (
        (contractType == null || contractType.isEmpty())
        && (department == null || department.isEmpty())
        && (description == null || description.isEmpty())
        && (employer == null || employer.isEmpty())
        && (endMonth == null || endMonth.isEmpty())
        && (endYear == null || endYear.isEmpty())
        && (role == null || role.isEmpty())
        && (startMonth == null || startMonth.isEmpty())
        && (startYear == null || startYear.isEmpty())
      );
  }

  private Map tablePrintableValues() {
    Map printable = new HashMap<>();

    printable.put("contractType", SummaryHelper.formatForDisplay(this.contractType, 15));
    printable.put("department", SummaryHelper.formatForDisplay(this.department, 10));
    printable.put("description", SummaryHelper.formatForDisplay(this.description, 36));
    printable.put("employer", SummaryHelper.formatForDisplay(this.employer, 25));
    printable.put("endMonth", SummaryHelper.formatForDisplay(this.endMonth, null));
    printable.put("endYear", SummaryHelper.formatForDisplay(this.endYear, null));
    printable.put("role", SummaryHelper.formatForDisplay(this.role, 20));
    printable.put("startMonth", SummaryHelper.formatForDisplay(this.startMonth, null));
    printable.put("startYear", SummaryHelper.formatForDisplay(this.startYear, null));
    return printable;
  }

  /**
   * Output the line in a format suitable for inclusion in an rST table.
   */
  public String toTableLine() {
    Map printable = this.tablePrintableValues();
    return String.format("| %-15s ", printable.get("contractType"))
      + String.format("| %-10s ", printable.get("department"))
      + String.format("| %-36s ", printable.get("description"))
      + String.format("| %-25s ", printable.get("employer"))
      + String.format("| %-9s ", printable.get("endMonth"))
      + String.format("| %-8s ", printable.get("endYear"))
      + String.format("| %-20s ", printable.get("role"))
      + String.format("| %-11s ", printable.get("startMonth"))
      + String.format("| %-10s |", printable.get("startYear"));
  }

  @Override
  public String toString() {
    Map printable = this.printableValues();
    return String.format("Contract Type: %s", printable.get("contractType"))
      + String.format(", Department: %s", printable.get("department"))
      + String.format(", Description: %s", printable.get("description"))
      + String.format(", Employer: %s", printable.get("employer"))
      + String.format(", End Month: %s", printable.get("endMonth"))
      + String.format(", End Year: %s", printable.get("endYear"))
      + String.format(", Role: %s", printable.get("role"))
      + String.format(", Start Month: %s", printable.get("startMonth"))
      + String.format(", Start Year: %s", printable.get("startYear"));
  }

  private Map printableValues() {
    Map printable = new HashMap<>();

    printable.put("contractType", SummaryHelper.formatForDisplay(this.contractType, null));
    printable.put("department", SummaryHelper.formatForDisplay(this.department, null));
    printable.put("description", SummaryHelper.formatForDisplay(this.description, null));
    printable.put("employer", SummaryHelper.formatForDisplay(this.employer, null));
    printable.put("endMonth", SummaryHelper.formatForDisplay(this.endMonth, null));
    printable.put("endYear", SummaryHelper.formatForDisplay(this.endYear, null));
    printable.put("role", SummaryHelper.formatForDisplay(this.role, null));
    printable.put("startMonth", SummaryHelper.formatForDisplay(this.startMonth, null));
    printable.put("startYear", SummaryHelper.formatForDisplay(this.startYear, null));
    return printable;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy