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

com.shapestone.authorization.Resource Maven / Gradle / Ivy

The newest version!
package com.shapestone.authorization;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * Name: Michael Williams
 * Date: 10/29/16.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class Resource {

  private String resourceId;
  private String resourceExternalId;
  private String name;
  private String description;
  private String customerPartyId;
  private Long modifiedDate;
  private Long createdDate;
  private List grantees;
  private List permissions;

  public Resource(Resource resource) {
    this.resourceId = resource.resourceId;
    this.resourceExternalId = resource.resourceExternalId;
    this.name = resource.name;
    this.description = resource.description;
    this.customerPartyId = resource.customerPartyId;
    this.modifiedDate = resource.modifiedDate;
    this.createdDate = resource.createdDate;
  }

  public Resource(String resourceId, String resourceExternalId, String name, String description,
                  String customerPartyId, Long modifiedDate, Long createdDate) {
    this.resourceId = resourceId;
    this.resourceExternalId = resourceExternalId;
    this.name = name;
    this.description = description;
    this.customerPartyId = customerPartyId;
    this.modifiedDate = modifiedDate;
    this.createdDate = createdDate;
  }

  public List getGrantees() {
    if (grantees == null) {
      grantees = new ArrayList<>();
    }

    return grantees;
  }

  public List getPermissions() {
    if (permissions == null) {
      permissions = new ArrayList<>();
    }
    return permissions;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy