-
Notifications
You must be signed in to change notification settings - Fork 2
/
Serializer.java
34 lines (27 loc) · 1.12 KB
/
Serializer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package cz.cvut.fel.adaptiverestfulapi.serialization;
import cz.cvut.fel.adaptiverestfulapi.core.HttpContext;
import cz.cvut.fel.adaptiverestfulapi.meta.configuration.Configuration;
import cz.cvut.fel.adaptiverestfulapi.meta.model.Model;
/**
* Serialization interface.
*/
public interface Serializer {
/**
* Serializes response content in the HTTP context.
* @param httpContext The HTTP context to serialize.
* @param model The model.
* @param configuration The configuration.
* @return The serialized context.
* @throws SerializationException
*/
public HttpContext serialize(HttpContext httpContext, Model model, Configuration configuration) throws SerializationException;
/**
* Deserializes request content in the HTTP context.
* @param httpContext The HTTP context to deserialize.
* @param model The model.
* @param configuration The configuration.
* @return The deserialized context.
* @throws SerializationException
*/
public HttpContext deserialize(HttpContext httpContext, Model model, Configuration configuration) throws SerializationException;
}