001/* 002 * Copyright 2005,2009 Ivan SZKIBA 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ini4j; 017 018public interface Profile extends MultiMap<String, Profile.Section>, CommentedMap<String, Profile.Section> 019{ 020 char PATH_SEPARATOR = '/'; 021 022 String getComment(); 023 024 void setComment(String value); 025 026 Section add(String sectionName); 027 028 void add(String sectionName, String optionName, Object value); 029 030 <T> T as(Class<T> clazz); 031 032 <T> T as(Class<T> clazz, String prefix); 033 034 String fetch(Object sectionName, Object optionName); 035 036 <T> T fetch(Object sectionName, Object optionName, Class<T> clazz); 037 038 String get(Object sectionName, Object optionName); 039 040 <T> T get(Object sectionName, Object optionName, Class<T> clazz); 041 042 String put(String sectionName, String optionName, Object value); 043 044 Section remove(Profile.Section section); 045 046 String remove(Object sectionName, Object optionName); 047 048 interface Section extends OptionMap 049 { 050 Section getChild(String key); 051 052 String getName(); 053 054 Section getParent(); 055 056 String getSimpleName(); 057 058 Section addChild(String key); 059 060 String[] childrenNames(); 061 062 Section lookup(String... path); 063 064 void removeChild(String key); 065 } 066}