blob: a41d7493aa46778042833c3ef5861c89b7610f55 [file] [log] [blame]
Jian Lia0bf4592017-02-03 17:43:21 +09001/*
2 * Copyright 2017-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.mapping;
17
Jian Li136fd6c2017-02-10 14:54:59 +090018import org.onosproject.mapping.address.MappingAddress;
19import org.onosproject.mapping.instructions.MappingInstruction;
20
21import java.util.List;
22
Jian Lia0bf4592017-02-03 17:43:21 +090023/**
24 * Abstraction of value of mapping information.
25 */
26public interface MappingValue {
Jian Li136fd6c2017-02-10 14:54:59 +090027
28 /**
29 * Obtains a mapping address.
30 *
31 * @return a mapping address
32 */
33 MappingAddress address();
34
35 /**
36 * Obtains a collection of mapping instructions.
37 *
38 * @return a collection of mapping instructions
39 */
40 List<MappingInstruction> instructions();
41
42 interface Builder {
43
44 /**
45 * Specifies the mapping address.
46 *
47 * @param address mapping address
48 * @return a mapping value builder
49 */
50 Builder withAddress(MappingAddress address);
51
52 /**
53 * Specifies a collection of mapping instructions.
54 *
55 * @param instructions a collection of mapping instructions
56 * @return a mapping value builder
57 */
58 Builder withInstructions(List<MappingInstruction> instructions);
59
60 /**
61 * Builds an immutable mapping value.
62 *
63 * @return a mapping value
64 */
65 MappingValue build();
66 }
Jian Lia0bf4592017-02-03 17:43:21 +090067}