Tabnine Logo
MediaTypeMap.convert
Code IndexAdd Tabnine to your IDE (free)

How to use
convert
method
in
org.jboss.resteasy.core.MediaTypeMap

Best Java code snippets using org.jboss.resteasy.core.MediaTypeMap.convert (Showing top 9 results out of 315)

origin: resteasy/Resteasy

/**
* Returns a list of objects sorted based on their media type where the first in the list
* is the best match
*
* @param accept mime to match
* @return list of objects
*/
public List<T> getPossible(MediaType accept)
{
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   ArrayList<T> copy = new ArrayList<T>();
   copy.addAll(everything);
   return copy;
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches);
 return convert(matches);
}
origin: resteasy/Resteasy

Collections.sort(newall);
all = newall;
everything = convert(newall);
origin: resteasy/Resteasy

public List<T> getPossible(MediaType accept, Class<?> type)
{
 List<T> cached = null;
 CachedMediaTypeAndClass cacheEntry = null;
 if (useCache)
 {
   cacheEntry = new CachedMediaTypeAndClass(type, accept);
   cached = classCache.get(cacheEntry);
   if (cached != null) return cached;
 }
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   matches.addAll(all);
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches, new TypedEntryComparator(type));
 cached = convert(matches);
 if (useCache) classCache.put(cacheEntry, cached);
 return cached;
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

/**
* Returns a list of objects sorted based on their media type where the first in the list
* is the best match
*
* @param accept mime to match
* @return
*/
public List<T> getPossible(MediaType accept)
{
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   ArrayList<T> copy = new ArrayList<T>();
   copy.addAll(everything);
   return copy;
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches);
 return convert(matches);
}
origin: org.jboss.resteasy/resteasy-core

/**
* Returns a list of objects sorted based on their media type where the first in the list
* is the best match
*
* @param accept mime to match
* @return list of objects
*/
public List<T> getPossible(MediaType accept)
{
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   ArrayList<T> copy = new ArrayList<T>();
   copy.addAll(everything);
   return copy;
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches);
 return convert(matches);
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

Collections.sort(newall);
all = newall;
everything = convert(newall);
origin: org.jboss.resteasy/resteasy-core

Collections.sort(newall);
all = newall;
everything = convert(newall);
origin: org.jboss.resteasy/resteasy-core

public List<T> getPossible(MediaType accept, Class<?> type)
{
 List<T> cached = null;
 CachedMediaTypeAndClass cacheEntry = null;
 if (useCache)
 {
   cacheEntry = new CachedMediaTypeAndClass(type, accept);
   cached = classCache.get(cacheEntry);
   if (cached != null) return cached;
 }
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   matches.addAll(all);
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches, new TypedEntryComparator(type));
 cached = convert(matches);
 if (useCache) classCache.put(cacheEntry, cached);
 return cached;
}
origin: org.jboss.resteasy/resteasy-jaxrs-20

public List<T> getPossible(MediaType accept, Class<?> type)
{
 List<T> cached = null;
 CachedMediaTypeAndClass cacheEntry = null;
 if (useCache)
 {
   cacheEntry = new CachedMediaTypeAndClass(type, accept);
   cached = classCache.get(cacheEntry);
   if (cached != null) return cached;
 }
 accept = new MediaType(accept.getType().toLowerCase(), accept.getSubtype().toLowerCase(), accept.getParameters());
 List<Entry<T>> matches = new ArrayList<Entry<T>>();
 if (accept.isWildcardType())
 {
   matches.addAll(all);
 }
 else
 {
   matches.addAll(wildcards);
   SubtypeMap<T> indexed = index.get(accept.getType());
   if (indexed != null)
   {
    matches.addAll(indexed.getPossible(accept));
   }
 }
 Collections.sort(matches, new TypedEntryComparator(type));
 cached = convert(matches);
 if (useCache) classCache.put(cacheEntry, cached);
 return cached;
}
org.jboss.resteasy.coreMediaTypeMapconvert

Popular methods of MediaTypeMap

  • getPossible
  • <init>
  • add
    Add an object to the media type map. This is synchronized to serialize adds.
  • clone
  • getClassCache

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now