14e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum/*
24e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * Copyright (C) 2017 The Android Open Source Project
34e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum *
44e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * Licensed under the Apache License, Version 2.0 (the "License");
54e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * you may not use this file except in compliance with the License.
64e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * You may obtain a copy of the License at
74e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum *
84e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum *      http://www.apache.org/licenses/LICENSE-2.0
94e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum *
104e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * Unless required by applicable law or agreed to in writing, software
114e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * distributed under the License is distributed on an "AS IS" BASIS,
124e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * See the License for the specific language governing permissions and
144e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum * limitations under the License.
154e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum */
164e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
174e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaumpackage android.net.lowpan;
184e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
194e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaumimport java.util.Map;
204e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
214e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum/** {@hide} */
224e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaumpublic abstract class LowpanProperty<T> {
234e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    public abstract String getName();
244e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
254e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    public abstract Class<T> getType();
264e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
274e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    public void putInMap(Map map, T value) {
284e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum        map.put(getName(), value);
294e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    }
304e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum
314e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    public T getFromMap(Map map) {
324e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum        return (T) map.get(getName());
334e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum    }
344e0c2195dd999859f4e79cec1884326fb52a5916Robert Quattlebaum}
35