001package com.box.sdk; 002 003import java.util.ArrayList; 004import java.util.List; 005 006/** 007 * Optional parameters for creating an updating a Retention Policy. 008 * 009 * @see BoxRetentionPolicy 010 */ 011public class RetentionPolicyParams { 012 013 /** 014 * @see #getCanOwnerExtendRetention() 015 */ 016 private boolean canOwnerExtendRetention; 017 018 /** 019 * @see #getAreOwnersNotified() 020 */ 021 private boolean areOwnersNotified; 022 023 /** 024 * @see #getDescription() 025 */ 026 private String description; 027 028 /** 029 * @see #getCustomNotificationRecipients() 030 */ 031 private List<BoxUser.Info> customNotificationRecipients; 032 033 /** 034 * Creates optional retention policy params with default values. 035 */ 036 public RetentionPolicyParams() { 037 this.canOwnerExtendRetention = false; 038 this.areOwnersNotified = false; 039 this.customNotificationRecipients = new ArrayList<>(); 040 this.description = ""; 041 } 042 043 /** 044 * @return the flag denoting whether the owner can extend the retention. 045 */ 046 public boolean getCanOwnerExtendRetention() { 047 return this.canOwnerExtendRetention; 048 } 049 050 /** 051 * Set the flag denoting whether the owner can extend the retentiion. 052 * 053 * @param canOwnerExtendRetention The flag value. 054 */ 055 public void setCanOwnerExtendRetention(boolean canOwnerExtendRetention) { 056 this.canOwnerExtendRetention = canOwnerExtendRetention; 057 } 058 059 /** 060 * @return the flag denoting whether owners and co-onwers are notified when the retention period is ending. 061 */ 062 public boolean getAreOwnersNotified() { 063 return this.areOwnersNotified; 064 } 065 066 /** 067 * Set the flag denoting whether owners and co-owners are notified when the retention period is ending. 068 * 069 * @param areOwnersNotified The flag value. 070 */ 071 public void setAreOwnersNotified(boolean areOwnersNotified) { 072 this.areOwnersNotified = areOwnersNotified; 073 } 074 075 /** 076 * @return The additional text description of the retention policy 077 */ 078 public String getDescription() { 079 return this.description; 080 } 081 082 /** 083 * Set additional text description of the retention policy. 084 * 085 * @param description The additional text description of the retention policy. 086 */ 087 public void setDescription(String description) { 088 this.description = description; 089 } 090 091 /** 092 * @return the list of extra users to notify when the retention period is ending. 093 */ 094 public List<BoxUser.Info> getCustomNotificationRecipients() { 095 return this.customNotificationRecipients; 096 } 097 098 /** 099 * Set the list of extra users to notify when the retention period is ending. 100 * 101 * @param customNotificationRecipients The list of users. 102 */ 103 public void setCustomNotificationRecipients(List<BoxUser.Info> customNotificationRecipients) { 104 this.customNotificationRecipients = customNotificationRecipients; 105 } 106 107 /** 108 * Add a user by ID to the list of people to notify when the retention period is ending. 109 * 110 * @param userID The ID of the user to add to the list. 111 */ 112 public void addCustomNotificationRecipient(String userID) { 113 BoxUser user = new BoxUser(null, userID); 114 this.customNotificationRecipients.add(user.new Info()); 115 116 } 117 118 /** 119 * Add a user to the list of people to notify when the retention period is ending. 120 * 121 * @param user The info of the user to add to the list 122 */ 123 public void addCustomNotificationRecipient(BoxUser user) { 124 this.customNotificationRecipients.add(user.new Info()); 125 } 126} 127