change override list to map
[jSite2.git] / src / net / pterodactylus / jsite / project / Project.java
index 04760e2..b80c293 100644 (file)
@@ -20,6 +20,8 @@
 package net.pterodactylus.jsite.project;
 
 import java.beans.PropertyChangeListener;
+import java.util.HashMap;
+import java.util.Map;
 
 import net.pterodactylus.util.beans.AbstractBean;
 
@@ -64,6 +66,9 @@ public class Project extends AbstractBean {
        /** The base path of the project. */
        private String basePath;
 
+       /** The overrides. */
+       private final Map<String, Override> overrides = new HashMap<String, Override>();
+
        /**
         * Creates a new project.
         */
@@ -208,4 +213,35 @@ public class Project extends AbstractBean {
                fireIfPropertyChanged(PROPERTY_BASE_PATH, oldBasePath, basePath);
        }
 
+       /**
+        * Adds an override for the given file.
+        *
+        * @param filePath
+        *            The file path
+        * @param override
+        *            The override for the file
+        */
+       public void addOverride(String filePath, Override override) {
+               overrides.put(filePath, override);
+       }
+
+       /**
+        * Removes the override for the given file.
+        *
+        * @param filePath
+        *            The file path for which to remove the override
+        */
+       public void removeOverride(String filePath) {
+               overrides.remove(filePath);
+       }
+
+       /**
+        * Returns the list of {@link Override}s.
+        *
+        * @return All overrides
+        */
+       public Map<String, Override> getOverrides() {
+               return overrides;
+       }
+
 }