2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.models.base;
26 * This interface is used to allow get methods to be placed on concepts that have embedded maps.
28 * <p>It forces those concepts with maps to implement the get methods specified on this interface as convenience methods
29 * to avoid concept users having to use a second level of referencing to access concepts in the maps.
31 * @param <C> the type of concept on which the interface is applied.
33 public interface PfConceptGetter<C> {
36 * Get the latest version for a concept with the given key.
38 * @param conceptKey The key of the concept
41 C get(PfConceptKey conceptKey);
44 * Get the latest version for a concept with the given key name.
46 * @param conceptKeyName The name of the concept
49 C get(String conceptKeyName);
52 * Get the latest version for a concept with the given key name and version.
54 * @param conceptKeyName The name of the concept
55 * @param conceptKeyVersion The version of the concept
58 C get(String conceptKeyName, String conceptKeyVersion);
61 * Get the all versions for a concept with the given key name.
63 * @param conceptKeyName The name of the concept
64 * @return The concepts
66 Set<C> getAll(String conceptKeyName);
69 * Get the all versions for a concept with the given key name and starting version.
71 * @param conceptKeyName The name of the concept
72 * @param conceptKeyVersion The first version version of the concept to get
73 * @return The concepts
75 Set<C> getAll(String conceptKeyName, String conceptKeyVersion);