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

org.atmosphere.wasync.Encoder Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
/*
 * Copyright 2014 Jeanfrancois Arcand
 *
 * 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 org.atmosphere.wasync;

/**
 * Encode the request's body (or transform) of type U into an object of type T. Encoder can be chained, e.g the result of
 * one Encoder can be passed to the next Encoder.
 *
 * @param  Any object.
 * @param  An instance of {@link String}, {@link java.io.InputStream} and {@link java.io.Reader}
 *
 * @author Jeanfrancois Arcand
 */
public interface Encoder {

    /**
     * Encode the object of type U into an object of type T.
     * @param s a request's body that has already been encoded or not
     * @return an encoded object. The list of supported encoded object are {@link String}, {@link java.io.InputStream} and {@link java.io.Reader}
     */
    T encode(U s);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy