001/*-
002 * #%L
003 * HAPI FHIR - Master Data Management
004 * %%
005 * Copyright (C) 2014 - 2024 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.mdm.blocklist.json;
021
022import ca.uhn.fhir.model.api.IModelJson;
023import com.fasterxml.jackson.annotation.JsonProperty;
024
025import java.util.ArrayList;
026import java.util.List;
027
028public class BlockListRuleJson implements IModelJson {
029        /**
030         * The resource type that this block list rule applies to.
031         */
032        @JsonProperty(value = "resourceType", required = true)
033        private String myResourceType;
034
035        /**
036         * The list of blocked fields that this rule applies to.
037         */
038        @JsonProperty(value = "fields", required = true)
039        private List<BlockedFieldJson> myBlockedFields;
040
041        public String getResourceType() {
042                return myResourceType;
043        }
044
045        public void setResourceType(String theResourceType) {
046                myResourceType = theResourceType;
047        }
048
049        public List<BlockedFieldJson> getBlockedFields() {
050                if (myBlockedFields == null) {
051                        myBlockedFields = new ArrayList<>();
052                }
053                return myBlockedFields;
054        }
055
056        public BlockedFieldJson addBlockListField() {
057                BlockedFieldJson rule = new BlockedFieldJson();
058                getBlockedFields().add(rule);
059                return rule;
060        }
061}