Search in sources :

Example 1 with CreateResponseBuilder

use of com.linkedin.restli.internal.server.response.CreateResponseBuilder in project rest.li by linkedin.

the class MethodAdapterRegistry method buildResponseBuilders.

private Map<ResourceMethod, RestLiResponseBuilder> buildResponseBuilders(ErrorResponseBuilder errorResponseBuilder) {
    Map<ResourceMethod, RestLiResponseBuilder> result = new HashMap<ResourceMethod, RestLiResponseBuilder>(ResourceMethod.values().length);
    result.put(ResourceMethod.GET, new GetResponseBuilder());
    result.put(ResourceMethod.BATCH_GET, new BatchGetResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.FINDER, new CollectionResponseBuilder());
    result.put(ResourceMethod.CREATE, new CreateResponseBuilder());
    result.put(ResourceMethod.PARTIAL_UPDATE, new UpdateResponseBuilder());
    result.put(ResourceMethod.UPDATE, new UpdateResponseBuilder());
    result.put(ResourceMethod.DELETE, new UpdateResponseBuilder());
    result.put(ResourceMethod.ACTION, new ActionResponseBuilder());
    result.put(ResourceMethod.BATCH_UPDATE, new BatchUpdateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_PARTIAL_UPDATE, new BatchUpdateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_CREATE, new BatchCreateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_DELETE, new BatchUpdateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.GET_ALL, new CollectionResponseBuilder());
    return Collections.unmodifiableMap(result);
}
Also used : BatchGetResponseBuilder(com.linkedin.restli.internal.server.response.BatchGetResponseBuilder) ActionResponseBuilder(com.linkedin.restli.internal.server.response.ActionResponseBuilder) HashMap(java.util.HashMap) BatchUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchUpdateResponseBuilder) UpdateResponseBuilder(com.linkedin.restli.internal.server.response.UpdateResponseBuilder) BatchUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchUpdateResponseBuilder) CollectionResponseBuilder(com.linkedin.restli.internal.server.response.CollectionResponseBuilder) BatchCreateResponseBuilder(com.linkedin.restli.internal.server.response.BatchCreateResponseBuilder) CreateResponseBuilder(com.linkedin.restli.internal.server.response.CreateResponseBuilder) BatchCreateResponseBuilder(com.linkedin.restli.internal.server.response.BatchCreateResponseBuilder) BatchGetResponseBuilder(com.linkedin.restli.internal.server.response.BatchGetResponseBuilder) GetResponseBuilder(com.linkedin.restli.internal.server.response.GetResponseBuilder) RestLiResponseBuilder(com.linkedin.restli.internal.server.response.RestLiResponseBuilder) ResourceMethod(com.linkedin.restli.common.ResourceMethod)

Example 2 with CreateResponseBuilder

use of com.linkedin.restli.internal.server.response.CreateResponseBuilder in project rest.li by linkedin.

the class DefaultMethodAdapterProvider method buildResponseBuilders.

private Map<ResourceMethod, RestLiResponseBuilder<?>> buildResponseBuilders(ErrorResponseBuilder errorResponseBuilder) {
    Map<ResourceMethod, RestLiResponseBuilder<?>> result = new HashMap<>(ResourceMethod.values().length);
    result.put(ResourceMethod.GET, new GetResponseBuilder());
    result.put(ResourceMethod.BATCH_GET, new BatchGetResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.FINDER, new FinderResponseBuilder());
    result.put(ResourceMethod.CREATE, new CreateResponseBuilder());
    result.put(ResourceMethod.PARTIAL_UPDATE, new PartialUpdateResponseBuilder());
    result.put(ResourceMethod.UPDATE, new UpdateResponseBuilder());
    result.put(ResourceMethod.DELETE, new DeleteResponseBuilder());
    result.put(ResourceMethod.ACTION, new ActionResponseBuilder());
    result.put(ResourceMethod.BATCH_UPDATE, new BatchUpdateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_PARTIAL_UPDATE, new BatchPartialUpdateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_CREATE, new BatchCreateResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_DELETE, new BatchDeleteResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.BATCH_FINDER, new BatchFinderResponseBuilder(errorResponseBuilder));
    result.put(ResourceMethod.GET_ALL, new GetAllResponseBuilder());
    return Collections.unmodifiableMap(result);
}
Also used : HashMap(java.util.HashMap) UpdateResponseBuilder(com.linkedin.restli.internal.server.response.UpdateResponseBuilder) BatchUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchUpdateResponseBuilder) BatchPartialUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchPartialUpdateResponseBuilder) PartialUpdateResponseBuilder(com.linkedin.restli.internal.server.response.PartialUpdateResponseBuilder) BatchPartialUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchPartialUpdateResponseBuilder) BatchCreateResponseBuilder(com.linkedin.restli.internal.server.response.BatchCreateResponseBuilder) BatchFinderResponseBuilder(com.linkedin.restli.internal.server.response.BatchFinderResponseBuilder) RestLiResponseBuilder(com.linkedin.restli.internal.server.response.RestLiResponseBuilder) FinderResponseBuilder(com.linkedin.restli.internal.server.response.FinderResponseBuilder) BatchFinderResponseBuilder(com.linkedin.restli.internal.server.response.BatchFinderResponseBuilder) GetAllResponseBuilder(com.linkedin.restli.internal.server.response.GetAllResponseBuilder) BatchGetResponseBuilder(com.linkedin.restli.internal.server.response.BatchGetResponseBuilder) BatchPartialUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchPartialUpdateResponseBuilder) PartialUpdateResponseBuilder(com.linkedin.restli.internal.server.response.PartialUpdateResponseBuilder) ActionResponseBuilder(com.linkedin.restli.internal.server.response.ActionResponseBuilder) BatchUpdateResponseBuilder(com.linkedin.restli.internal.server.response.BatchUpdateResponseBuilder) BatchDeleteResponseBuilder(com.linkedin.restli.internal.server.response.BatchDeleteResponseBuilder) BatchCreateResponseBuilder(com.linkedin.restli.internal.server.response.BatchCreateResponseBuilder) CreateResponseBuilder(com.linkedin.restli.internal.server.response.CreateResponseBuilder) BatchDeleteResponseBuilder(com.linkedin.restli.internal.server.response.BatchDeleteResponseBuilder) DeleteResponseBuilder(com.linkedin.restli.internal.server.response.DeleteResponseBuilder) BatchGetResponseBuilder(com.linkedin.restli.internal.server.response.BatchGetResponseBuilder) GetResponseBuilder(com.linkedin.restli.internal.server.response.GetResponseBuilder) ResourceMethod(com.linkedin.restli.common.ResourceMethod)

Aggregations

ResourceMethod (com.linkedin.restli.common.ResourceMethod)2 ActionResponseBuilder (com.linkedin.restli.internal.server.response.ActionResponseBuilder)2 BatchCreateResponseBuilder (com.linkedin.restli.internal.server.response.BatchCreateResponseBuilder)2 BatchGetResponseBuilder (com.linkedin.restli.internal.server.response.BatchGetResponseBuilder)2 BatchUpdateResponseBuilder (com.linkedin.restli.internal.server.response.BatchUpdateResponseBuilder)2 CreateResponseBuilder (com.linkedin.restli.internal.server.response.CreateResponseBuilder)2 GetResponseBuilder (com.linkedin.restli.internal.server.response.GetResponseBuilder)2 RestLiResponseBuilder (com.linkedin.restli.internal.server.response.RestLiResponseBuilder)2 UpdateResponseBuilder (com.linkedin.restli.internal.server.response.UpdateResponseBuilder)2 HashMap (java.util.HashMap)2 BatchDeleteResponseBuilder (com.linkedin.restli.internal.server.response.BatchDeleteResponseBuilder)1 BatchFinderResponseBuilder (com.linkedin.restli.internal.server.response.BatchFinderResponseBuilder)1 BatchPartialUpdateResponseBuilder (com.linkedin.restli.internal.server.response.BatchPartialUpdateResponseBuilder)1 CollectionResponseBuilder (com.linkedin.restli.internal.server.response.CollectionResponseBuilder)1 DeleteResponseBuilder (com.linkedin.restli.internal.server.response.DeleteResponseBuilder)1 FinderResponseBuilder (com.linkedin.restli.internal.server.response.FinderResponseBuilder)1 GetAllResponseBuilder (com.linkedin.restli.internal.server.response.GetAllResponseBuilder)1 PartialUpdateResponseBuilder (com.linkedin.restli.internal.server.response.PartialUpdateResponseBuilder)1