87 lines
2.1 KiB
Java
87 lines
2.1 KiB
Java
package eu.eudat.model.persist;
|
|
|
|
import eu.eudat.commons.enums.StorageType;
|
|
import eu.eudat.commons.validation.old.ValidEnum;
|
|
import eu.eudat.data.StorageFileEntity;
|
|
import jakarta.validation.constraints.NotEmpty;
|
|
import jakarta.validation.constraints.NotNull;
|
|
import jakarta.validation.constraints.Size;
|
|
|
|
import java.time.Duration;
|
|
import java.util.UUID;
|
|
|
|
public class StorageFilePersist {
|
|
|
|
@NotNull(message = "{validation.empty}")
|
|
@NotEmpty(message = "{validation.empty}")
|
|
@Size(max = StorageFileEntity._nameLen, message = "{validation.largerthanmax}")
|
|
private String name;
|
|
|
|
@NotNull(message = "{validation.empty}")
|
|
@NotEmpty(message = "{validation.empty}")
|
|
@Size(max = StorageFileEntity._extensionLen, message = "{validation.largerthanmax}")
|
|
private String extension;
|
|
|
|
|
|
|
|
@NotNull(message = "{validation.empty}")
|
|
@NotEmpty(message = "{validation.empty}")
|
|
@Size(max = StorageFileEntity._mimeTypeLen, message = "{validation.largerthanmax}")
|
|
private String mimeType;
|
|
|
|
@NotNull(message = "{validation.empty}")
|
|
@ValidEnum(message = "{validation.empty}")
|
|
private StorageType storageType;
|
|
private Duration lifetime;
|
|
|
|
private UUID ownerId;
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getExtension() {
|
|
return extension;
|
|
}
|
|
|
|
public void setExtension(String extension) {
|
|
this.extension = extension;
|
|
}
|
|
|
|
public String getMimeType() {
|
|
return mimeType;
|
|
}
|
|
|
|
public void setMimeType(String mimeType) {
|
|
this.mimeType = mimeType;
|
|
}
|
|
|
|
public StorageType getStorageType() {
|
|
return storageType;
|
|
}
|
|
|
|
public void setStorageType(StorageType storageType) {
|
|
this.storageType = storageType;
|
|
}
|
|
|
|
public UUID getOwnerId() {
|
|
return ownerId;
|
|
}
|
|
|
|
public void setOwnerId(UUID ownerId) {
|
|
this.ownerId = ownerId;
|
|
}
|
|
|
|
public Duration getLifetime() {
|
|
return lifetime;
|
|
}
|
|
|
|
public void setLifetime(Duration lifetime) {
|
|
this.lifetime = lifetime;
|
|
}
|
|
}
|