@Override public boolean isSecured() { return action.isSecured(); } }
private boolean matchesContentType(List<ContentType> contentTypes) { boolean contentTypeMatch = false; for (ContentType contentType : contentTypes) { if (CONTENT_TYPE.isCompatible(contentType)) { contentTypeMatch = true; break; } } return contentTypeMatch; } }
/** * Checks if either the primary type or the sub type is a wildcard. * * @return <code>true</code> if the primary type or sub type is a wildcard. */ public boolean isWildcard() { return isWildcardType() || isWildcardSubType(); }
@Override public List<HttpParameter> getParameters(final Type type) { return FluentIterable.from(extraParams) .filter(parameter -> parameter.getType() == type) .append(action.getParameters(type)) .toList(); }
private String buildMatrixString(RestAction<?> action) { List<HttpParameter> parameters = action.getParameters(Type.MATRIX); StringBuilder matrixString = new StringBuilder(); for (HttpParameter parameter : parameters) { for (Entry<String, String> entry : parameter.getEncodedEntries()) { matrixString.append(';') .append(entry.getKey()) .append('=') .append(entry.getValue()); } } return matrixString.toString(); }
@Override public Boolean hasFormParams() { return action.hasFormParams(); }
@Override public List<ContentType> getClientConsumedContentTypes() { return action.getClientConsumedContentTypes(); }
@Override public Object getBodyParam() { return action.getBodyParam(); }
@Override public List<ContentType> getClientProducedContentTypes() { return action.getClientProducedContentTypes(); }
@Override public String getResultClass() { return action.getResultClass(); }
@Override public String getBodyClass() { return action.getBodyClass(); }
@Override public String getPath() { return action.getPath(); }
@Override public HttpMethod getHttpMethod() { return action.getHttpMethod(); }
@Override public Boolean hasBodyParam() { return action.hasBodyParam(); }
public boolean isCompatible(ContentType other) { if (other == null) { return false; } else if (getType().equals(WILDCARD) || other.getType().equals(WILDCARD)) { return true; } else if (getType().equals(other.getType())) { return getSubType().equals(WILDCARD) || other.getSubType().equals(WILDCARD) || getSubType().equals(other.getSubType()); } return false; }
public ContentType( String type, String subType, Map<String, String> parameters) { this.type = valueOrWildcard(type); this.subType = valueOrWildcard(subType); this.parameters = parameters; }
/** * Checks if the sub type is a wildcard. * * @return <code>true</code> if the sub type is a wildcard. */ public boolean isWildcardSubType() { return getSubType().equals(WILDCARD); }
/** * Checks if either the primary type or the sub type is a wildcard. * * @return <code>true</code> if the primary type or sub type is a wildcard. */ public boolean isWildcard() { return isWildcardType() || isWildcardSubType(); }
@Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } }
public ContentType( String type, String subType, Map<String, String> parameters) { this.type = valueOrWildcard(type); this.subType = valueOrWildcard(subType); this.parameters = parameters; }