1 /* 2 * Licensed to the University Corporation for Advanced Internet Development, 3 * Inc. (UCAID) under one or more contributor license agreements. See the 4 * NOTICE file distributed with this work for additional information regarding 5 * copyright ownership. The UCAID licenses this file to You under the Apache 6 * License, Version 2.0 (the "License"); you may not use this file except in 7 * compliance with the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package edu.internet2.middleware.shibboleth.common.attribute.filtering.provider; 19 20 /** 21 * Represents a value filtering rule for a particular attribute. 22 */ 23 public class AttributeRule { 24 25 /** Unique ID of the attribute this rule applies to. */ 26 private String attributeId; 27 28 /** Filter that permits the release of attribute values. */ 29 private MatchFunctor permitValueRule; 30 31 /** Filter that denies the release of attribute values. */ 32 private MatchFunctor denyValueRule; 33 34 /** 35 * Constructor. 36 * 37 * @param id unique ID of this rule 38 */ 39 public AttributeRule(String id){ 40 attributeId = id; 41 } 42 43 /** 44 * Gets the ID of the attribute to which this rule applies. 45 * 46 * @return ID of the attribute to which this rule applies 47 */ 48 public String getAttributeId(){ 49 return attributeId; 50 } 51 52 /** 53 * Gets the filter that permits the release of attribute values. 54 * 55 * @return filter that permits the release of attribute values 56 */ 57 public MatchFunctor getPermitValueRule(){ 58 return permitValueRule; 59 } 60 61 /** 62 * Sets the filter that permits the release of attribute values. 63 * 64 * @param filter filter that permits the release of attribute values 65 */ 66 public void setPermitValueRule(MatchFunctor filter){ 67 permitValueRule = filter; 68 } 69 70 /** 71 * Gets the filter that denies the release of attribute values. 72 * 73 * @return filter that denies the release of attribute values 74 */ 75 public MatchFunctor getDenyValueRule() { 76 return denyValueRule; 77 } 78 79 /** 80 * Sets the filter that denies the release of attribute values. 81 * 82 * @param filter filter that denies the release of attribute values 83 */ 84 public void setDenyValueRule(MatchFunctor filter) { 85 denyValueRule = filter; 86 } 87 }