View Javadoc

1   /*
2    * Copyright 2005,2009 Ivan SZKIBA
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   */
16  package org.ini4j;
17  
18  public interface OptionMap extends MultiMap<String, String>, CommentedMap<String, String>
19  {
20      <T> T getAll(Object key, Class<T> clazz);
21  
22      void add(String key, Object value);
23  
24      void add(String key, Object value, int index);
25  
26      <T> T as(Class<T> clazz);
27  
28      <T> T as(Class<T> clazz, String keyPrefix);
29  
30      String fetch(Object key);
31  
32      String fetch(Object key, String defaultValue);
33  
34      String fetch(Object key, int index);
35  
36      <T> T fetch(Object key, Class<T> clazz);
37  
38      <T> T fetch(Object key, Class<T> clazz, T defaultValue);
39  
40      <T> T fetch(Object key, int index, Class<T> clazz);
41  
42      <T> T fetchAll(Object key, Class<T> clazz);
43  
44      void from(Object bean);
45  
46      void from(Object bean, String keyPrefix);
47  
48      String get(Object key, String defaultValue);
49  
50      <T> T get(Object key, Class<T> clazz);
51  
52      <T> T get(Object key, Class<T> clazz, T defaultValue);
53  
54      <T> T get(Object key, int index, Class<T> clazz);
55  
56      String put(String key, Object value);
57  
58      String put(String key, Object value, int index);
59  
60      void putAll(String key, Object value);
61  
62      void to(Object bean);
63  
64      void to(Object bean, String keyPrefix);
65  }