/**
* List of the string identifiers for the available properties.
*/
- public static Collection<String> PDPPOLICY_PROPERTIES;
+ private static Collection<String> pdpPolicyProperties;
- private final Object data;
- private List<PDPPolicy> policies;
+ private final transient Object data;
+ private transient List<PDPPolicy> policies;
@SuppressWarnings("unchecked")
public PDPPolicyContainer(Object data) {
super();
this.data = data;
if (this.data instanceof PDPGroup) {
- policies = new ArrayList<PDPPolicy> (((PDPGroup) this.data).getPolicies());
+ policies = new ArrayList<> (((PDPGroup) this.data).getPolicies());
}
if (this.data instanceof PDP) {
- policies = new ArrayList<PDPPolicy> (((PDP) this.data).getPolicies());
+ policies = new ArrayList<> (((PDP) this.data).getPolicies());
}
if (this.data instanceof Set) {
- policies = new ArrayList<PDPPolicy> ((Set<PDPPolicy>)data);
+ policies = new ArrayList<> ((Set<PDPPolicy>)data);
}
if (this.policies == null) {
logger.info("NULL policies");
}
@Override
- public Object addItemAfter(Object previousItemId)
- throws UnsupportedOperationException {
+ public Object addItemAfter(Object previousItemId){
return null;
}
@Override
public Collection<?> getContainerPropertyIds() {
- return PDPPOLICY_PROPERTIES;
+ return pdpPolicyProperties;
}
@Override
}
@Override
- public Object addItem() throws UnsupportedOperationException {
+ public Object addItem(){
throw new UnsupportedOperationException("Cannot add an empty policy.");
}
@Override
- public boolean removeItem(Object itemId)
- throws UnsupportedOperationException {
+ public boolean removeItem(Object itemId){
if (logger.isTraceEnabled()) {
logger.trace("removeItem: " + itemId);
}
@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
- Object defaultValue) throws UnsupportedOperationException {
+ Object defaultValue){
return false;
}
@Override
- public boolean removeContainerProperty(Object propertyId)
- throws UnsupportedOperationException {
+ public boolean removeContainerProperty(Object propertyId){
return false;
}
@Override
- public boolean removeAllItems() throws UnsupportedOperationException {
+ public boolean removeAllItems(){
return false;
}
}
@Override
- public Object addItemAt(int index) throws UnsupportedOperationException {
+ public Object addItemAt(int index) {
if (logger.isTraceEnabled()) {
logger.trace("addItemAt: " + index);
}