Class SourcePrefHelper

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String pref  
      protected SourceType type  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SourcePrefHelper​(java.lang.String pref, SourceType type)
      Constructs a new SourcePrefHelper for the given preference key.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SourcePrefHelper

        protected SourcePrefHelper​(java.lang.String pref,
                                   SourceType type)
        Constructs a new SourcePrefHelper for the given preference key.
        Parameters:
        pref - The preference key
        type - The source type
        Since:
        12825
    • Method Detail

      • getDefault

        public abstract java.util.Collection<ExtendedSourceEntrygetDefault()
        Returns the default sources provided by JOSM core.
        Returns:
        the default sources provided by JOSM core
      • serialize

        public java.util.Map<java.lang.String,​java.lang.String> serialize​(SourceEntry entry)
        Serializes the given source entry as a map.
        Parameters:
        entry - source entry to serialize
        Returns:
        map (key=value)
      • deserialize

        public SourceEntry deserialize​(java.util.Map<java.lang.String,​java.lang.String> entryStr)
        Deserializes the given map as a source entry.
        Parameters:
        entryStr - map (key=value)
        Returns:
        source entry
      • get

        public java.util.List<SourceEntryget()
        Returns the list of sources.
        Returns:
        The list of sources
      • put

        public boolean put​(java.util.Collection<? extends SourceEntry> entries)
        Saves a list of sources to JOSM preferences.
        Parameters:
        entries - list of sources
        Returns:
        true, if something has changed (i.e. value is different than before)
      • serializeList

        private java.util.List<java.util.Map<java.lang.String,​java.lang.String>> serializeList​(java.util.Collection<? extends SourceEntry> entries)
      • getActiveUrls

        public final java.util.Set<java.lang.String> getActiveUrls()
        Returns the set of active source URLs.
        Returns:
        The set of active source URLs.