Interface Adapter<T extends org.eclipse.ditto.model.base.json.Jsonifiable<?>>
-
- Type Parameters:
T
- the type mapped by thisAdapter
.
- All Known Subinterfaces:
ErrorResponseAdapter<T>
,EventAdapter<T>
,ModifyCommandAdapter<T>
,ModifyCommandResponseAdapter<T>
,QueryCommandAdapter<T>
,QueryCommandResponseAdapter<T>
- All Known Implementing Classes:
AbstractAdapter
,AbstractErrorResponseAdapter
,ThingSearchCommandAdapter
public interface Adapter<T extends org.eclipse.ditto.model.base.json.Jsonifiable<?>>
- Since:
- 1.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
fromAdaptable(Adaptable adaptable)
Maps the givenadaptable
to its correspondingT
.Set<TopicPath.Action>
getActions()
Retrieve the set of actions supported by this adapter.Set<TopicPath.Channel>
getChannels()
Retrieve the set of channels supported by this adapter.Set<TopicPath.Criterion>
getCriteria()
Retrieve the set of criteria supported by this adapter.Set<TopicPath.Group>
getGroups()
Retrieve the set of groups supported by this adapter.default Set<TopicPath.SearchAction>
getSearchActions()
Return the set of search actions supported by this adapter.boolean
isForResponses()
Retrieve whether this adapter is for responses.default boolean
requiresSubject()
Retrieve whether this adapter requires a subject in the topic.default Adaptable
toAdaptable(T t)
Adaptable
toAdaptable(T t, TopicPath.Channel channel)
Maps the givent
to its correspondingAdaptable
.
-
-
-
Method Detail
-
fromAdaptable
T fromAdaptable(Adaptable adaptable)
Maps the givenadaptable
to its correspondingT
.- Parameters:
adaptable
- the adaptable to map.- Returns:
- the mapped object.
- Throws:
NullPointerException
- ifadaptable
isnull
.
-
toAdaptable
default Adaptable toAdaptable(T t)
- Parameters:
t
- the object to map.- Returns:
- the mapped adaptable.
- Throws:
NullPointerException
- ift
isnull
.
-
toAdaptable
Adaptable toAdaptable(T t, TopicPath.Channel channel)
Maps the givent
to its correspondingAdaptable
.- Parameters:
t
- the object to map.channel
- the channel that was used to send the signal- Returns:
- the mapped adaptable.
- Throws:
NullPointerException
- ift
isnull
.IllegalArgumentException
- ifchannel
is unknown.
-
getGroups
Set<TopicPath.Group> getGroups()
Retrieve the set of groups supported by this adapter.- Returns:
- the supported groups.
-
getChannels
Set<TopicPath.Channel> getChannels()
Retrieve the set of channels supported by this adapter.- Returns:
- the supported channels.
-
getCriteria
Set<TopicPath.Criterion> getCriteria()
Retrieve the set of criteria supported by this adapter.- Returns:
- the supported criteria.
-
getActions
Set<TopicPath.Action> getActions()
Retrieve the set of actions supported by this adapter.- Returns:
- the set of actions.
-
getSearchActions
default Set<TopicPath.SearchAction> getSearchActions()
Return the set of search actions supported by this adapter. It is the empty set by default.- Returns:
- the collection of supported search actions.
-
isForResponses
boolean isForResponses()
Retrieve whether this adapter is for responses.- Returns:
- whether this adapter is for responses.
-
requiresSubject
default boolean requiresSubject()
Retrieve whether this adapter requires a subject in the topic. Only relevant for message commands and responses and acknowledgements.- Returns:
- whether a subject in the topic is required.
-
-