001/* 002 * Syncany, www.syncany.org 003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com> 004 * 005 * This program is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation, either version 3 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 017 */ 018package org.syncany.config.to; 019 020import java.util.Map; 021 022import org.simpleframework.xml.Attribute; 023import org.simpleframework.xml.ElementMap; 024 025/** 026 * The typed property list is a helper data structure that allows storing an 027 * object of a certain type with its properties . 028 * 029 * <p>It is used in the {@link RepoTO} for chunker, multichunker and transformer, 030 * and in the {@link ConfigTO} for the connection settings. 031 * 032 * <p>It uses the Simple framework for XML serialization, and its corresponding 033 * annotation-based configuration. 034 * 035 * @see <a href="http://simple.sourceforge.net/">Simple framework</a> 036 * @author Philipp C. Heckel (philipp.heckel@gmail.com) 037 */ 038public abstract class TypedPropertyListTO { 039 @Attribute(required=true) 040 private String type; 041 042 @ElementMap(entry="property", key="name", required=false, attribute=true, inline=true) 043 protected Map<String, String> settings; 044 045 public String getType() { 046 return type; 047 } 048 049 public void setType(String type) { 050 this.type = type; 051 } 052 053 public Map<String, String> getSettings() { 054 return settings; 055 } 056 057 public void setSettings(Map<String, String> settings) { 058 this.settings = settings; 059 } 060}