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

com.github.jasminb.jsonapi.IntegerIdHandler Maven / Gradle / Ivy

Go to download

JSONAPI-Converter is a library that provides means for integrating with services using JSON API specification.

There is a newer version: 0.14
Show newest version
package com.github.jasminb.jsonapi;

/**
 * Handles {@link Integer} as resource identifier type.
 *
 * @author jbegic
 */
public class IntegerIdHandler implements ResourceIdHandler {
	@Override
	public String asString(Object identifier) {
		if (identifier != null) {
			return String.valueOf(identifier);
		}
		return null;
	}
	
	@Override
	public Integer fromString(String source) {
		if (source != null) {
			return Integer.valueOf(source);
		}
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy