/*
 * Copyright 2016 Sai Pullabhotla.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.jmethods.catatumbo;

/**
 * @author Sai Pullabhotla
 *
 */
public class DefaultDatastoreCursor implements DatastoreCursor {

	private String encoded = null;

	/**
	 * Creates a new instance of <code>DatastoreCursor</code>.
	 * 
	 * @param encoded
	 *            cursor data
	 */
	public DefaultDatastoreCursor(String encoded) {
		super();
		this.encoded = encoded;
	}

	/**
	 * @return the data
	 */
	@Override
	public String getEncoded() {
		return encoded;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return encoded;
	}

}

@@ -632,111 +632,397 @@
 o;%0A%0A
-/**%0A * @author Sai Pullabhotla%0A *%0A */%0Apublic class DefaultDatastoreCursor implements DatastoreCursor %7B%0A
+import java.io.Serializable;%0Aimport java.util.Objects;%0A%0A/**%0A * Default implementation of %7B@link DatastoreCursor%7D interface.%0A * %0A * @author Sai Pullabhotla%0A *%0A */%0Apublic class DefaultDatastoreCursor implements DatastoreCursor, Serializable %7B%0A%0A%09/**%0A%09 * Serial version UID%0A%09 */%0A%09private static final long serialVersionUID = -6434001816829294681L;%0A%0A%09/**%0A%09 * Cursor data in URL-safe format%0A%09 */
 %0A%09pr
@@ -1092,16 +1092,23 @@
 f %3Ccode%3E
+Default
 Datastor
@@ -1177,266 +1177,768 @@
 data
-%0A%09 */%0A%09public DefaultDatastoreCursor(String encoded) %7B%0A%09%09super();%0A%09%09this.encoded = encoded;%0A%09%7D%0A%0A%09/**%0A%09 * @return the data%0A%09 */%0A%09@Override%0A%09public String getEncoded() %7B%0A%09%09return encoded;%0A%09%7D%0A%0A%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see java.lang.Object#toString()%0A%09 */
+, in URL-safe format. A %3Ccode%3Enull%3C/code%3E value%0A%09 *            will be converted to an empty string.%0A%09 */%0A%09public DefaultDatastoreCursor(String encoded) %7B%0A%09%09if (encoded == null) %7B%0A%09%09%09encoded = %22%22;%0A%09%09%7D%0A%09%09this.encoded = encoded;%0A%09%7D%0A%0A%09/**%0A%09 * Returns the encoded value of this cursor, in URL-safe format.%0A%09 * %0A%09 * @return the encoded value of this cursor, in URL-safe format.%0A%09 */%0A%09@Override%0A%09public String getEncoded() %7B%0A%09%09return encoded;%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (obj == null %7C%7C !(obj instanceof DefaultDatastoreCursor)) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09DefaultDatastoreCursor that = (DefaultDatastoreCursor) obj;%0A%09%09return this.encoded.equals(that.encoded);%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return Objects.hashCode(encoded);%0A%09%7D%0A
 %0A%09@O

Implement equals and hashCode methods in DefaultDatastoreCursor class #8