public class ConnegUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends Metadata> |
getPreferredMetadata(List<T> supported,
List<Preference<T>> preferences)
Returns the preferred metadata taking into account both metadata
supported by the server and client preferences.
|
static Variant |
getPreferredVariant(ClientInfo clientInfo,
List<? extends Variant> variants,
MetadataService metadataService)
Returns the best variant representation for a given resource according
the the client preferences.
A default language is provided in case the variants don't match the client preferences. |
public static <T extends Metadata> T getPreferredMetadata(List<T> supported, List<Preference<T>> preferences)
supported
- The metadata supported by the server.preferences
- The client preferences.public static Variant getPreferredVariant(ClientInfo clientInfo, List<? extends Variant> variants, MetadataService metadataService)
clientInfo
- The client preferences.variants
- The list of variants to compare.metadataService
- The metadata service.Copyright © 2005–2016. All rights reserved.