public abstract class SourcePrefHelper extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
pref |
protected SourceType |
type |
Constructor and Description |
---|
SourcePrefHelper(java.lang.String pref,
SourceType type)
Constructs a new
SourcePrefHelper for the given preference key. |
Modifier and Type | Method and Description |
---|---|
SourceEntry |
deserialize(java.util.Map<java.lang.String,java.lang.String> entryStr)
Deserializes the given map as a source entry.
|
java.util.List<SourceEntry> |
get()
Returns the list of sources.
|
java.util.Set<java.lang.String> |
getActiveUrls()
Returns the set of active source URLs.
|
abstract java.util.Collection<ExtendedSourceEntry> |
getDefault()
Returns the default sources provided by JOSM core.
|
boolean |
put(java.util.Collection<? extends SourceEntry> entries)
Saves a list of sources to JOSM preferences.
|
java.util.Map<java.lang.String,java.lang.String> |
serialize(SourceEntry entry)
Serializes the given source entry as a map.
|
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
serializeList(java.util.Collection<? extends SourceEntry> entries) |
private final java.lang.String pref
protected final SourceType type
public SourcePrefHelper(java.lang.String pref, SourceType type)
SourcePrefHelper
for the given preference key.pref
- The preference keytype
- The source typepublic abstract java.util.Collection<ExtendedSourceEntry> getDefault()
public java.util.Map<java.lang.String,java.lang.String> serialize(SourceEntry entry)
entry
- source entry to serializepublic SourceEntry deserialize(java.util.Map<java.lang.String,java.lang.String> entryStr)
entryStr
- map (key=value)public java.util.List<SourceEntry> get()
public boolean put(java.util.Collection<? extends SourceEntry> entries)
entries
- list of sourcestrue
, if something has changed (i.e. value is different than before)private java.util.List<java.util.Map<java.lang.String,java.lang.String>> serializeList(java.util.Collection<? extends SourceEntry> entries)
public final java.util.Set<java.lang.String> getActiveUrls()