Package org.n52.svalbard.encode
Interface Encoder<T,S>
-
- Type Parameters:
T- the resulting type, the "Target"S- the input type, the "Source"
- All Superinterfaces:
Component<EncoderKey>,Keyed<EncoderKey>
- All Known Subinterfaces:
ConformanceClassEncoder<T,S>,ObservationEncoder<S,T>,ProcedureEncoder<S,T>,SchemaAwareEncoder<T,S>,StreamingEncoder<T,S>
- All Known Implementing Classes:
AbstractDelegatingEncoder,UVFEncoder
public interface Encoder<T,S> extends Component<EncoderKey>
Generic interface for Encoders.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Tencode(S objectToEncode)Encodes the specified object.Tencode(S objectToEncode, EncodingContext additionalValues)Encodes the specified object with the specified EncodingContext .MediaTypegetContentType()default Set<SupportedType>getSupportedTypes()Get theSupportedType
-
-
-
Method Detail
-
encode
T encode(S objectToEncode) throws EncodingException
Encodes the specified object.- Parameters:
objectToEncode- the object to encode- Returns:
- the encoded object
- Throws:
EncodingException- if an error occurs
-
encode
T encode(S objectToEncode, EncodingContext additionalValues) throws EncodingException
Encodes the specified object with the specified EncodingContext .- Parameters:
objectToEncode- the object to encodeadditionalValues- the helper values- Returns:
- the encoded object
- Throws:
EncodingException- if an error occurs
-
getSupportedTypes
default Set<SupportedType> getSupportedTypes()
Get theSupportedType- Returns:
- the supported key types
-
getContentType
MediaType getContentType()
- Returns:
- the content type of the encoded response.
-
-