public class ConnegUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Metadata> |
getPreferredMetadata(java.util.List<T> supported,
java.util.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,
java.util.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(java.util.List<T> supported, java.util.List<Preference<T>> preferences)
supported - The metadata supported by the server.preferences - The client preferences.public static Variant getPreferredVariant(ClientInfo clientInfo, java.util.List<? extends Variant> variants, MetadataService metadataService)
clientInfo - The client preferences.variants - The list of variants to compare.metadataService - The metadata service.Copyright © 2005-2012. All Rights Reserved.