All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.solovyev.android.db.StringVersionedEntityMapper Maven / Gradle / Ivy

There is a newer version: 1.1.18
Show newest version
package org.solovyev.android.db;

import android.database.Cursor;
import org.solovyev.common.Converter;
import org.solovyev.common.VersionedEntity;

import javax.annotation.Nonnull;

import static org.solovyev.common.Entities.newEntity;

/**
 * User: serso
 * Date: 7/25/12
 * Time: 2:24 PM
 */
public class StringVersionedEntityMapper implements Converter> {

	@Nonnull
	private static final Converter> instance = new StringVersionedEntityMapper();

	private StringVersionedEntityMapper() {
	}

	@Nonnull
	public static Converter> getInstance() {
		return instance;
	}

	@Nonnull
	@Override
	public VersionedEntity convert(@Nonnull Cursor cursor) {

		final String id = cursor.getString(0);
		final int version = cursor.getInt(1);

		return newEntity(id, version);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy