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 Profile extends MultiMap<String, Profile.Section>, CommentedMap<String, Profile.Section>
19  {
20      char PATH_SEPARATOR = '/';
21  
22      String getComment();
23  
24      void setComment(String value);
25  
26      Section add(String sectionName);
27  
28      void add(String sectionName, String optionName, Object value);
29  
30      <T> T as(Class<T> clazz);
31  
32      <T> T as(Class<T> clazz, String prefix);
33  
34      String fetch(Object sectionName, Object optionName);
35  
36      <T> T fetch(Object sectionName, Object optionName, Class<T> clazz);
37  
38      String get(Object sectionName, Object optionName);
39  
40      <T> T get(Object sectionName, Object optionName, Class<T> clazz);
41  
42      String put(String sectionName, String optionName, Object value);
43  
44      Section remove(Profile.Section section);
45  
46      String remove(Object sectionName, Object optionName);
47  
48      interface Section extends OptionMap
49      {
50          Section getChild(String key);
51  
52          String getName();
53  
54          Section getParent();
55  
56          String getSimpleName();
57  
58          Section addChild(String key);
59  
60          String[] childrenNames();
61  
62          Section lookup(String... path);
63  
64          void removeChild(String key);
65      }
66  }