package io.trygvis.engine.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.util.Optional; import static java.util.Optional.ofNullable; @Entity public class Artifact extends AbstractEntity { @Column(length = 100, nullable = false) private String groupId; @Column(length = 100, nullable = false) private String artifactId; @Column(length = 100, nullable = false) private String version; @Column(length = 100) private String classifier; @Column(length = 100, nullable = false) private String extension; protected Artifact() { } public Artifact(String groupId, String artifactId, String version, String classifier, String extension) { this.groupId = groupId; this.artifactId = artifactId; this.version = version; this.classifier = classifier; this.extension = extension; } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getVersion() { return version; } public Optional getClassifier() { return ofNullable(classifier); } public String getExtension() { return extension; } }