public Token(final String token, final String secret, final String consumerKey, final String callbackUrl, final Map<String, List<String>> attributes) { this(token, secret, consumerKey, callbackUrl, null, Collections.<String>emptySet(), new ImmutableMultivaluedMap<>(getImmutableMap(attributes))); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }
@Override public MultivaluedMap<String, String> getQueryParameters(final boolean decode) { if (decode) { if (decodedQueryParamsView != null) { return decodedQueryParamsView; } decodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), true)); return decodedQueryParamsView; } else { if (encodedQueryParamsView != null) { return encodedQueryParamsView; } encodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), false)); return encodedQueryParamsView; } }
@Override public MultivaluedMap<String, String> getPathParameters(final boolean decode) { if (decode) { if (decodedTemplateValuesView != null) { return decodedTemplateValuesView; } else if (decodedTemplateValues == null) { decodedTemplateValues = new MultivaluedHashMap<>(); for (final Map.Entry<String, List<String>> e : encodedTemplateValues.entrySet()) { decodedTemplateValues.put( UriComponent.decode(e.getKey(), UriComponent.Type.PATH_SEGMENT), // we need to keep the ability to add new entries e.getValue().stream().map(s -> UriComponent.decode(s, UriComponent.Type.PATH)) .collect(Collectors.toCollection(ArrayList::new))); } } decodedTemplateValuesView = new ImmutableMultivaluedMap<>(decodedTemplateValues); return decodedTemplateValuesView; } else { return encodedTemplateValuesView; } }
@Override public MultivaluedMap<String, String> getPathParameters(final boolean decode) { if (decode) { if (decodedTemplateValuesView != null) { return decodedTemplateValuesView; } else if (decodedTemplateValues == null) { decodedTemplateValues = new MultivaluedHashMap<>(); for (final Map.Entry<String, List<String>> e : encodedTemplateValues.entrySet()) { decodedTemplateValues.put( UriComponent.decode(e.getKey(), UriComponent.Type.PATH_SEGMENT), // we need to keep the ability to add new entries e.getValue().stream().map(s -> UriComponent.decode(s, UriComponent.Type.PATH)) .collect(Collectors.toCollection(ArrayList::new))); } } decodedTemplateValuesView = new ImmutableMultivaluedMap<>(decodedTemplateValues); return decodedTemplateValuesView; } else { return encodedTemplateValuesView; } }
@Override public MultivaluedMap<String, String> getQueryParameters(final boolean decode) { if (decode) { if (decodedQueryParamsView != null) { return decodedQueryParamsView; } decodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), true)); return decodedQueryParamsView; } else { if (encodedQueryParamsView != null) { return encodedQueryParamsView; } encodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), false)); return encodedQueryParamsView; } }
@Override public MultivaluedMap<String, String> getQueryParameters(final boolean decode) { if (decode) { if (decodedQueryParamsView != null) { return decodedQueryParamsView; } decodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), true)); return decodedQueryParamsView; } else { if (encodedQueryParamsView != null) { return encodedQueryParamsView; } encodedQueryParamsView = new ImmutableMultivaluedMap<>(UriComponent.decodeQuery(getRequestUri(), false)); return encodedQueryParamsView; } }
@Override public MultivaluedMap<String, String> getPathParameters(final boolean decode) { if (decode) { if (decodedTemplateValuesView != null) { return decodedTemplateValuesView; } else if (decodedTemplateValues == null) { decodedTemplateValues = new MultivaluedHashMap<>(); for (final Map.Entry<String, List<String>> e : encodedTemplateValues.entrySet()) { decodedTemplateValues.put( UriComponent.decode(e.getKey(), UriComponent.Type.PATH_SEGMENT), // we need to keep the ability to add new entries e.getValue().stream().map(s -> UriComponent.decode(s, UriComponent.Type.PATH)) .collect(Collectors.toCollection(ArrayList::new))); } } decodedTemplateValuesView = new ImmutableMultivaluedMap<>(decodedTemplateValues); return decodedTemplateValuesView; } else { return encodedTemplateValuesView; } }
public MultivaluedMap<String, Object> getAllQueries() { return new ImmutableMultivaluedMap<>(queries); }
public Token(final String token, final String secret, final String consumerKey, final String callbackUrl, final Map<String, List<String>> attributes) { this(token, secret, consumerKey, callbackUrl, null, Collections.<String>emptySet(), new ImmutableMultivaluedMap<>(getImmutableMap(attributes))); }
public Token(final String token, final String secret, final String consumerKey, final String callbackUrl, final Map<String, List<String>> attributes) { this(token, secret, consumerKey, callbackUrl, null, Collections.<String>emptySet(), new ImmutableMultivaluedMap<>(getImmutableMap(attributes))); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }
public ApiResponse(UUID id, HttpResponseStatus status, ByteBuf content, String contentType) { super(id, content, contentType, new ImmutableMultivaluedMap<>(new MultivaluedHashMap<String, String>())); this.status = status; }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Returns an empty immutable map. * * @return an empty immutable map. */ public static <K, V> ImmutableMultivaluedMap<K, V> empty() { return new ImmutableMultivaluedMap<K, V>(new MultivaluedHashMap<K, V>()); }