Class AcceptList

java.lang.Object
org.apache.jena.atlas.web.AcceptList

public class AcceptList extends Object
  • Constructor Details

    • AcceptList

      public AcceptList(List<MediaRange> mediaRanges)
      Create a list of accept items from the give strings.
      Parameters:
      mediaRanges -
    • AcceptList

      public AcceptList(MediaRange... acceptItems)
      Create a list of accept items from the give MediaTypes.
      Parameters:
      acceptItems -
    • AcceptList

      public AcceptList(String headerString)
      Parse an HTTP Accept (or etc) header string.
      Parameters:
      headerString -
  • Method Details

    • create

      public static AcceptList create(MediaType... acceptItems)
      Create a list of accept items from the give MediaTypes.
      Parameters:
      acceptItems -
    • create

      public static AcceptList create(String... acceptStrings)
      Create a list of accept items from strings.
      Parameters:
      acceptStrings -
    • entries

      public List<MediaRange> entries()
    • match

      public MediaRange match(MediaType offer)
      Find and return a match for a specific MediaType. Returns the Accept header entry best matched or null.
    • match

      public static MediaType match(AcceptList proposalList, AcceptList offerList)
      Find the best thing in offer list 8sever side) matching the proposal (client, Accept header). "best" means highest q value, with left most being better for same q.
      Parameters:
      proposalList - Client list of possibilities
      offerList - Server list of possibilities
      Returns:
      MediaType
    • first

      public MediaRange first()
    • toString

      public String toString()
      Overrides:
      toString in class Object