com.mindee.product.resume.ResumeV1SocialNetworksUrl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mindee-api-java Show documentation
Show all versions of mindee-api-java Show documentation
Java Library to call Mindee's Off-The-Shelf and Custom APIs
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 social network profiles of the candidate.
*/
@Getter
@JsonIgnoreProperties(ignoreUnknown = true)
public class ResumeV1SocialNetworksUrl extends BaseField implements LineItemField {
/**
* The name of the social network.
*/
@JsonProperty("name")
String name;
/**
* The URL of the social network.
*/
@JsonProperty("url")
String url;
public boolean isEmpty() {
return (
(name == null || name.isEmpty())
&& (url == null || url.isEmpty())
);
}
/**
* Output the line in a format suitable for inclusion in an rST table.
*/
public String toTableLine() {
Map printable = this.printableValues();
return String.format("| %-20s ", printable.get("name"))
+ String.format("| %-50s |", printable.get("url"));
}
@Override
public String toString() {
Map printable = this.printableValues();
return String.format("Name: %s", printable.get("name"))
+ String.format(", URL: %s", printable.get("url"));
}
private Map printableValues() {
Map printable = new HashMap<>();
printable.put("name", SummaryHelper.formatForDisplay(this.name, 20));
printable.put("url", SummaryHelper.formatForDisplay(this.url, 50));
return printable;
}
}