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

com.formkiq.server.domain.FolderAccess Maven / Gradle / Ivy

package com.formkiq.server.domain;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.Type;

import com.formkiq.server.domain.type.FolderPermission;

/**
 * Access Control for Folders Domain.
 *
 */
@Entity
@Table(name = "folders_access")
public class FolderAccess {

    /** identifier column. */
    @Id
    @Column(name = "folder_access_id", unique = true, columnDefinition = "uuid")
    @Type(type = "pg-uuid")
    private UUID folderaccessid;

    /** User ID Column. */
    @NotNull
    @Column(name = "user_id", nullable = false, columnDefinition = "uuid")
    @Type(type = "pg-uuid")
    private UUID userid;

    /** Folder ID column. */
    @NotNull
    @Column(name = "folder_id", nullable = false, columnDefinition = "uuid")
    @Type(type = "pg-uuid")
    private UUID folderid;

    /** Permissions, comma delimited. */
    @NotNull
    @Column(name = "permissions", nullable = false)
    private String permissions;

    /** inserted column. */
    @NotNull
    @Column(name = "inserted_date", nullable = false)
    private Date insertedDate;

    /**
     * constructor.
     */
    public FolderAccess() {
    }

    /**
     * @return {@link UUID}
     */
    public UUID getFolderaccessid() {
        return this.folderaccessid;
    }

    /**
     * @param folderaccess {@link UUID}
     */
    public void setFolderaccessid(final UUID folderaccess) {
        this.folderaccessid = folderaccess;
    }

    /**
     * @return {@link UUID}
     */
    public UUID getUserid() {
        return this.userid;
    }

    /**
     * @param user {@link UUID}
     */
    public void setUserid(final UUID user) {
        this.userid = user;
    }

    /**
     * @return {@link UUID}
     */
    public UUID getFolderid() {
        return this.folderid;
    }

    /**
     * @param folder {@link String}
     */
    public void setFolderid(final UUID folder) {
        this.folderid = folder;
    }

    /**
     * @return {@link String}
     */
    public String getPermissions() {
        return this.permissions;
    }

    /**
     * @param perms {@link String}
     */
    public void setPermissions(final String perms) {
        this.permissions = perms;
    }

    /**
     * @param list {@link List}
     */
    public void setPermissions(final List list) {
        this.permissions = StringUtils.join(list, ",");
    }

    /**
     * @return {@link Date}
     */
    public Date getInsertedDate() {
        return this.insertedDate != null ? (Date) this.insertedDate.clone()
                : null;
    }

    /**
     * @param date {@link Date}
     */
    public void setInsertedDate(final Date date) {
        this.insertedDate = date != null ? (Date) date.clone() : null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy