public class MessageUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copyAcceptableRequestSize(Integer acceptableRequestSize,
org.eclipse.californium.core.coap.OptionSet optionSet)
Copy AcceptableRequestSize to
OptionSet. |
static void |
copyEntityTagValue(org.mule.runtime.api.metadata.TypedValue<Object> entityTagValue,
org.eclipse.californium.core.coap.OptionSet optionSet,
org.mule.runtime.api.transformation.TransformationService transformationService)
Copy EntityTagValue to
OptionSet. |
static void |
copyLocationPath(String locationPath,
org.eclipse.californium.core.coap.OptionSet optionSet)
Copy LocationPath to
OptionSet. |
static void |
copyLocationQuery(List<QueryParam> locationQuery,
org.eclipse.californium.core.coap.OptionSet optionSet)
Copy LocationQuery to
OptionSet. |
static void |
copyMaxAge(Long maxAge,
org.eclipse.californium.core.coap.OptionSet optionSet)
Copy MaxAge to
OptionSet. |
static void |
copyOptions(List<OtherOption> otherOptions,
org.eclipse.californium.core.coap.OptionSet optionSet,
org.mule.runtime.api.transformation.TransformationService transformationService)
Copy other options from list of other options to
OptionSet. |
static void |
copyOptions(RequestOptionsParams requestOptions,
org.eclipse.californium.core.coap.OptionSet optionSet,
org.mule.runtime.api.transformation.TransformationService transformationService)
Copy options from
RequestOptionsParams to OptionSet. |
static void |
copyOptions(ResponseOptionsParams responseOptions,
org.eclipse.californium.core.coap.OptionSet optionSet,
org.mule.runtime.api.transformation.TransformationService transformationService)
Copy options from
ResponseOptionsParams to OptionSet. |
static void |
copyResponseSize(Integer responseSize,
org.eclipse.californium.core.coap.OptionSet optionSet)
Copy ResponseSize to
OptionSet. |
static Optional<List<DefaultEntityTag>> |
getList(List<byte[]> bytesList)
Convenience method to create a list of Entity-tags form a list of byte arrays.
|
static boolean |
isEqual(org.eclipse.californium.core.coap.option.OptionDefinition left,
org.eclipse.californium.core.coap.option.OptionDefinition right)
Establish equality of two option definitions based on their properties.
|
static boolean |
isIn(DefaultEntityTag etag,
Collection<DefaultEntityTag> etags)
Check a collection of Entity-tags whether it contains the Entity-tag.
|
static String |
queryString(List<? extends AbstractQueryParam> defaultQueryParams,
List<? extends AbstractQueryParam> queryParams)
Construct string representation of query parameters, merged with default parameters.
|
static byte[] |
toBytes(Object toConvert,
org.mule.runtime.api.transformation.TransformationService transformationService)
Convert an object to byte array.
|
static org.eclipse.californium.core.coap.option.OptionDefinition |
toCfOptionDefinition(OtherOptionConfig otherOptionConfig)
Convert other option configuration to Cf option definition.
|
static OptionFormat |
toOptionFormat(org.eclipse.californium.core.coap.OptionNumberRegistry.OptionFormat format)
Convert Cf format to option format.
|
static String |
uriString(List<String> path,
List<? extends AbstractQueryParam> query)
Create UriString from path and query.
|
public static void copyOptions(RequestOptionsParams requestOptions, org.eclipse.californium.core.coap.OptionSet optionSet, org.mule.runtime.api.transformation.TransformationService transformationService) throws InternalInvalidOptionValueException
RequestOptionsParams to OptionSet.requestOptions - to copy fromoptionSet - to copy totransformationService - Mule transformation service.InternalInvalidOptionValueException - When given option value could not be copiedpublic static void copyOptions(List<OtherOption> otherOptions, org.eclipse.californium.core.coap.OptionSet optionSet, org.mule.runtime.api.transformation.TransformationService transformationService) throws InternalInvalidOptionValueException, InternalUnkownOptionException
OptionSet.otherOptions - to copy from.optionSet - to copy to.transformationService - Mules transformation service for unknown option value types.InternalInvalidOptionValueException - When given option value is not valid.InternalUnkownOptionException - When given option alias was not defined.public static void copyOptions(ResponseOptionsParams responseOptions, org.eclipse.californium.core.coap.OptionSet optionSet, org.mule.runtime.api.transformation.TransformationService transformationService) throws InternalInvalidOptionValueException
ResponseOptionsParams to OptionSet.responseOptions - The options to copy.optionSet - The set to copy to.transformationService - Mule transformation service.InternalInvalidOptionValueException - When given option value is invalid.public static void copyEntityTagValue(org.mule.runtime.api.metadata.TypedValue<Object> entityTagValue, org.eclipse.californium.core.coap.OptionSet optionSet, org.mule.runtime.api.transformation.TransformationService transformationService) throws InternalInvalidOptionValueException
OptionSet.entityTagValue - The entityTagValue to copy.optionSet - The set to copy to.transformationService - Mule transformation service.InternalInvalidOptionValueException - When given option value is invalid.public static void copyMaxAge(Long maxAge, org.eclipse.californium.core.coap.OptionSet optionSet) throws InternalInvalidOptionValueException
OptionSet.maxAge - The options to copy.optionSet - The set to copy to.InternalInvalidOptionValueException - When given option value is invalid.public static void copyLocationPath(String locationPath, org.eclipse.californium.core.coap.OptionSet optionSet) throws InternalInvalidOptionValueException
OptionSet.locationPath - The options to copy.optionSet - The set to copy to.InternalInvalidOptionValueException - When given option value is invalid.public static void copyLocationQuery(List<QueryParam> locationQuery, org.eclipse.californium.core.coap.OptionSet optionSet) throws InternalInvalidOptionValueException
OptionSet.locationQuery - The options to copy.optionSet - The set to copy to.InternalInvalidOptionValueException - When given option value is invalid.public static void copyResponseSize(Integer responseSize, org.eclipse.californium.core.coap.OptionSet optionSet) throws InternalInvalidOptionValueException
OptionSet.responseSize - The options to copy.optionSet - The set to copy to.InternalInvalidOptionValueException - When given option value is invalid.public static void copyAcceptableRequestSize(Integer acceptableRequestSize, org.eclipse.californium.core.coap.OptionSet optionSet) throws InternalInvalidOptionValueException
OptionSet.acceptableRequestSize - The options to copy.optionSet - The set to copy to.InternalInvalidOptionValueException - When given option value is invalid.public static org.eclipse.californium.core.coap.option.OptionDefinition toCfOptionDefinition(OtherOptionConfig otherOptionConfig)
otherOptionConfig - The option config to create definition from.public static boolean isEqual(org.eclipse.californium.core.coap.option.OptionDefinition left,
org.eclipse.californium.core.coap.option.OptionDefinition right)
left - The first option definition.right - The second option definition.true when the definition are equal otherwise falsepublic static OptionFormat toOptionFormat(org.eclipse.californium.core.coap.OptionNumberRegistry.OptionFormat format)
format - The Cf option format.public static byte[] toBytes(Object toConvert, org.mule.runtime.api.transformation.TransformationService transformationService)
toConvert - The object to convert.InternalInvalidByteArrayValueException - When object cannot be converted to bytes.public static String queryString(List<? extends AbstractQueryParam> defaultQueryParams, List<? extends AbstractQueryParam> queryParams)
defaultQueryParams - The default parameters.queryParams - The query parameters.public static String uriString(List<String> path, List<? extends AbstractQueryParam> query)
path - The optional list of path segements.query - The optional list of query parameters.public static Optional<List<DefaultEntityTag>> getList(List<byte[]> bytesList) throws OptionValueException
bytesList - The List of Byte arrays to make a list of Entity-tags from.OptionValueException - when the Entity-tag could not be created from bytespublic static boolean isIn(DefaultEntityTag etag, Collection<DefaultEntityTag> etags)
etag - The Entity-tag to check.etags - The collection of Entity-tags to find the Entity-tag in.Copyright © 2019–2025 Teslanet.nl. All rights reserved.