package com.jcwhatever.bukkit.generic.warp;

import org.bukkit.Location;

import com.jcwhatever.bukkit.generic.storage.IDataNode;

public class Warp {
	private String _warpName;
	private String _warpSearchName;
	private Location _location;
	private IDataNode _settings;
			
	public Warp (String warpName, Location location, IDataNode settings) {
		_warpName = warpName;
		_warpSearchName = warpName.toLowerCase();		
		_location = location;
		_settings = settings;
	}
	
	public String getName() {
		return _warpName;
	}
	
	public String getSearchName() {
		return _warpSearchName;
	}
	
	public Location getLocation() {
		return _location;
	}
	
	public void setLocation(Location location) {
		_location = location;
		_settings.set(_warpName, location);
		_settings.saveAsync(null);
	}
}
@@ -49,37 +49,8 @@
 ort 
-org.bukkit.Location;%0A%0Aimport 
 com.
@@ -94,16 +94,134 @@
 taNode;%0A
+import com.jcwhatever.bukkit.generic.utils.PreCon;%0Aimport org.bukkit.Location;%0A%0A/**%0A * Represents a warp location.%0A */
 %0Apublic 
@@ -233,16 +233,17 @@
  Warp %7B%0A
+%0A
 %09private
@@ -235,32 +235,38 @@
 arp %7B%0A%0A%09private 
+final 
 String _warpName
@@ -276,16 +276,22 @@
 private 
+final 
 String _
@@ -319,61 +319,243 @@
 ate 
-Location _location;%0A%09private IDataNode _settings;%0A%09%09%09
+final IDataNode _dataNode;%0A    private Location _location;%0A%0A    /**%0A     * Constructor.%0A     *%0A     * @param warpName  The name of the warp.%0A     * @param location  The warp location.%0A     * @param dataNode  The warp data node.%0A     */
 %0A%09pu
@@ -611,24 +611,24 @@
 ataNode 
-settings
+dataNode
 ) %7B%0A%09%09_w
@@ -724,85 +724,194 @@
 %0A%09%09_
-settings = settings;%0A%09%7D%0A%09%0A%09public String getName() %7B%0A%09%09return _warpName;%0A%09%7D%0A%09
+dataNode = dataNode;%0A%09%7D%0A%0A    /**%0A     * Get the name of the warp.%0A     */%0A%09public String getName() %7B%0A%09%09return _warpName;%0A%09%7D%0A%0A    /**%0A     * Get the name of the warp in lowercase.%0A     */
 %0A%09pu
@@ -965,25 +965,70 @@
 rchName;%0A%09%7D%0A
-%09
+%0A    /**%0A     * Get the warp location.%0A     */
 %0A%09public Loc
@@ -1072,17 +1072,112 @@
 ion;%0A%09%7D%0A
-%09
+%0A    /**%0A     * Set the warp location.%0A     *%0A     * @param location  The warp location.%0A     */
 %0A%09public
@@ -1215,16 +1215,51 @@
 tion) %7B%0A
+        PreCon.notNull(location);%0A%0A
 %09%09_locat
@@ -1277,24 +1277,24 @@
 ion;%0A%09%09_
-settings
+dataNode
 .set(_wa
@@ -1319,16 +1319,16 @@
 %0A%09%09_
-settings
+dataNode
 .sav

Add JavaDoc comments