001// --------------------------------------------------------------------------------
002// Copyright 2002-2024 Echo Three, LLC
003//
004// Licensed under the Apache License, Version 2.0 (the "License");
005// you may not use this file except in compliance with the License.
006// You may obtain a copy of the License at
007//
008//     http://www.apache.org/licenses/LICENSE-2.0
009//
010// Unless required by applicable law or agreed to in writing, software
011// distributed under the License is distributed on an "AS IS" BASIS,
012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013// See the License for the specific language governing permissions and
014// limitations under the License.
015// --------------------------------------------------------------------------------
016
017package com.echothree.util.common.form;
018
019import java.io.Serializable;
020import java.util.HashMap;
021import java.util.HashSet;
022import java.util.Map;
023import java.util.Set;
024
025public class TransferOptions
026        implements Serializable {
027    
028    private Map<Class, Set<String>> classesAndOptions = new HashMap<>();
029
030    public TransferOptions addClassAndProperty(Class clazz, String property) {
031        Set<String> options = classesAndOptions.get(clazz);
032        
033        if(options == null) {
034            options = new HashSet<>();
035            
036            classesAndOptions.put(clazz, options);
037        }
038        
039        if(property != null) {
040            options.add(property);
041        }
042
043        return this;
044    }
045    
046    public Set<String> getOptions(Class clazz) {
047        return classesAndOptions.get(clazz);
048    }
049    
050}