 	var afterCursor: String?
 	var nextHref: NSURL?
 	var previousHref: NSURL?
+	
+	func toDictionary() -> NSDictionary {
+		var dictionary = NSDictionary()
+		
+		if let count = self.count {
+			dictionary.setValue(NSNumber(integer: count), forKey: "count")
+		}
+		
+		if let limit = self.limit {
+			dictionary.setValue(NSNumber(integer: limit), forKey: "limit")
+		}
+		
+		if let beforeCursor = self.beforeCursor {
+			dictionary.setValue(beforeCursor, forKey: "beforeCursor")
+		}
+		
+		if let afterCursor = self.afterCursor {
+			dictionary.setValue(afterCursor, forKey: "afterCursor")
+		}
+		
+		if let nextHref = self.nextHref {
+			dictionary.setValue(nextHref, forKey: "nextHref")
+		}
+		
+		if let previousHref = self.previousHref {
+			dictionary.setValue(previousHref, forKey: "previousHref")
+		}
+		
+		return dictionary
+	}
+	
+	static func fromDictionary(dictionary: NSDictionary) -> PaginationData {
+		return PaginationData(
+			count: (dictionary.valueForKey("count") as? NSNumber)?.integerValue,
+			limit: (dictionary.valueForKey("limit") as? NSNumber)?.integerValue,
+			beforeCursor: dictionary.valueForKey("beforeCursor") as? String,
+			afterCursor: dictionary.valueForKey("afterCursor") as? String,
+			nextHref: dictionary.valueForKey("nextHref") as? NSURL,
+			previousHref: dictionary.valueForKey("previousHref") as? NSURL
+		)
+	}
 }
 
 

	public required init(arrayLiteral elements: Resource...) {
		self.resources = elements
		self.isLoaded = true
	}
	
	// MARK: Printable protocol

	init(_ resource: Resource) {
		self.resource = resource
		self.isLoaded = true
	}
	
	// MARK: NSCoding
	
	public required init(coder: NSCoder) {
		self.isLoaded = coder.decodeBoolForKey("isLoaded")
		self.resource = coder.decodeObjectForKey("resource") as? Resource

		if let type = coder.decodeObjectForKey("linkType") as? String {
			self.link = (href: coder.decodeObjectForKey("linkHref") as? NSURL, type: type, id: coder.decodeObjectForKey("linkID") as? String)
		}
	}
	
	public func encodeWithCoder(coder: NSCoder) {
		coder.encodeBool(self.isLoaded, forKey: "isLoaded")
		coder.encodeObject(self.resource, forKey: "resource")
		
		if let link = self.link {
			coder.encodeObject(link.href, forKey: "linkHref")
			coder.encodeObject(link.type, forKey: "linkType")
			coder.encodeObject(link.id, forKey: "linkID")
		}
	}
	
	// MARK: Printable
