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

com.lightbend.lagom.javadsl.api.deser.PathParamSerializer Maven / Gradle / Ivy

There is a newer version: 1.5.5
Show newest version
/*
 * Copyright (C) 2016 Lightbend Inc. 
 */
package com.lightbend.lagom.javadsl.api.deser;

import org.pcollections.PSequence;

/**
 * A path param serializer is responsible for serializing and deserializing parameters that are extracted from and
 * formatted into paths.
 *
 * When used in URLs, a path param serializer is used both for path segments as well as query string parameters.  It is
 * expected that the serializer will consume and return singleton sequences for path segments, but may return 0 to many
 * values for query string parameters.
 *
 * @param  The type of the path parameter.
 */
public interface PathParamSerializer {

    /**
     * Serialize the given parameter into path parameters.
     *
     * @param parameter The parameter to serialize.
     * @return The parameters.
     */
    PSequence serialize(Param parameter);

    /**
     * Deserialize the parameters into a deserialized parameter.
     *
     * @return The deserialized parameter.
     */
    Param deserialize(PSequence parameters);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy