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

com.github.jasminb.jsonapi.StringIdHandler 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 String} as resource identifier type.
 *
 * @author jbegic
 */
public class StringIdHandler implements ResourceIdHandler {
	
	/**
	 * Creates new StringIdHandler.
	 *
	 */
	public StringIdHandler() {
		// Default constructor
	}
	
	@Override
	public String asString(Object identifier) {
		if (identifier != null) {
			return String.valueOf(identifier);
		}
		return null;
	}
	
	@Override
	public String fromString(String source) {
		return source;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy