当前位置: 首页>>代码示例>>Java>>正文


Java SortDirection类代码示例

本文整理汇总了Java中com.desk.java.apiclient.model.SortDirection的典型用法代码示例。如果您正苦于以下问题:Java SortDirection类的具体用法?Java SortDirection怎么用?Java SortDirection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SortDirection类属于com.desk.java.apiclient.model包,在下文中一共展示了SortDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: searchCasesById

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@GET(CASES_URI + "/search")
Call<ApiResponse<Case>> searchCasesById(@Query("since_id") int since_id, @Query("per_page") int perPage,
    @Query("page") int page, @Query("sort_field") String sortField,
    @Query("sort_direction") SortDirection sortDirection, @Query("embed") Embed embed,
    @Query("fields") Fields fields);
 
开发者ID:forcedotcom,项目名称:scmt-server,代码行数:6,代码来源:CaseService.java

示例2: getArticlesNotifiesCallbackOnSuccess

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesNotifiesCallbackOnSuccess() throws Exception {
    final Call mockCall = mock(Call.class);

    when(mockArticleService.getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            eq(true), // testing that this is true
            any(TopicIds.class),
            any(BrandIds.class),
            anyString(),
            any(SortDirection.class))).thenReturn(mockCall);

    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((RetrofitCallback) invocation.getArguments()[0]).onResponse(mockCall, Response.success(new ApiResponse<Article>()));
            return null;
        }
    }).when(mockCall).enqueue(any(Callback.class));

    articleProvider.getArticles(ALL_TOPICS, ALL_BRANDS, 1, callback);
    verify(callback).onArticlesLoaded(anyInt(), anyListOf(Article.class), anyBoolean());
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:26,代码来源:ArticleProviderTest.java

示例3: getArticlesNotifiesCallbackOnError

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesNotifiesCallbackOnError() throws Exception {
    final Call mockCall = mock(Call.class);

    when(mockArticleService.getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            eq(true), // testing that this is true
            any(TopicIds.class),
            any(BrandIds.class),
            anyString(),
            any(SortDirection.class))).thenReturn(mockCall);

    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((RetrofitCallback) invocation.getArguments()[0]).onFailure(mockCall, new RuntimeException());
            return null;
        }
    }).when(mockCall).enqueue(any(Callback.class));

    articleProvider.getArticles(ALL_TOPICS, ALL_BRANDS, 1, callback);
    verify(callback).onArticlesLoadError(any(ErrorResponse.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:26,代码来源:ArticleProviderTest.java

示例4: findArticlesNotifiesCallbackOnError

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void findArticlesNotifiesCallbackOnError() throws Exception {
    final Call mockCall = mock(Call.class);

    when(mockArticleService.searchArticles(
            anyString(),
            anyInt(),
            anyInt(),
            isNull(TopicIds.class), // testing that this is null
            any(BrandIds.class),
            anyBoolean(),
            anyString(),
            any(SortDirection.class),
            anyString())).thenReturn(mockCall);

    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((RetrofitCallback) invocation.getArguments()[0]).onFailure(mockCall, new RuntimeException());
            return null;
        }
    }).when(mockCall).enqueue(any(Callback.class));

    articleProvider.findArticles(ALL_TOPICS, ALL_BRANDS, "query", 1, callback);
    verify(callback).onArticlesLoadError(any(ErrorResponse.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:27,代码来源:ArticleProviderTest.java

示例5: getArticlesNotifiesCallbackOnSuccess

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesNotifiesCallbackOnSuccess() throws Exception {
    final Call mockCall = mock(Call.class);

    when(mockTopicService.getTopics(
            anyString(),
            anyBoolean(),
            anyInt(),
            anyString(),
            any(SortDirection.class))).thenReturn(mockCall);

    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((TopicProvider.RetrofitCallback) invocation.getArguments()[0]).onResponse(mockCall, Response.success(new ApiResponse<Topic>()));
            return null;
        }
    }).when(mockCall).enqueue(any(Callback.class));

    topicProvider.getTopics(ALL_BRANDS, callbacks);
    verify(callbacks).onTopicsLoaded(anyListOf(Topic.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:23,代码来源:TopicProviderTest.java

示例6: getArticlesNotifiesCallbackOnError

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesNotifiesCallbackOnError() throws Exception {
    final Call mockCall = mock(Call.class);

    when(mockTopicService.getTopics(
            anyString(),
            anyBoolean(),
            anyInt(),
            anyString(),
            any(SortDirection.class))).thenReturn(mockCall);

    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((TopicProvider.RetrofitCallback) invocation.getArguments()[0]).onFailure(mockCall, new RuntimeException());
            return null;
        }
    }).when(mockCall).enqueue(any(Callback.class));

    topicProvider.getTopics(ALL_BRANDS, callbacks);
    verify(callbacks).onTopicsLoadError(any(ErrorResponse.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:23,代码来源:TopicProviderTest.java

示例7: searchCustomersByUpdatedAt

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@GET(CUSTOMERS_URI + "/search")
Call<ApiResponse<Customer>> searchCustomersByUpdatedAt(@Query("since_updated_at") Integer since_updated_at,
    @Query("per_page") int perPage, @Query("page") int page, @Query("sort_field") String sortField, 
    @Query("sort_direction") SortDirection sortDirection, @Query("fields") Fields fields);
 
开发者ID:forcedotcom,项目名称:scmt-server,代码行数:5,代码来源:CustomerService.java

示例8: callDesk

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Override
protected DeskBaseResponse<ApiResponse<D>> callDesk(DeskUtil du)
{
    // get a service
    CaseService service = du.getDeskClient().cases();
    Response<ApiResponse<Case>> resp = null;
    try
    {
        if (!delta)
        {
            resp = service
                .searchCasesById(lastRecordId, DESK_PAGE_SIZE_CASE, page, "id", SortDirection.ASC, null, null)
                .execute();
        }
        else
        {
            resp = service.searchCasesByUpdatedDate(updatedAt, DESK_PAGE_SIZE_CASE, page, "updated_at",
                SortDirection.ASC, null, null).execute();
        }
    }
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    DeskBaseResponse<ApiResponse<D>> d = new DeskBaseResponse<>();
    d.errorCode = resp.code();
    d.setIsSuccess(resp.isSuccess());
    d.body = (ApiResponse<D>) resp.body();
    d.setHeaders(resp.headers());
    d.setMessage(resp.message());        
    return d;
}
 
开发者ID:forcedotcom,项目名称:scmt-server,代码行数:34,代码来源:DeskCaseMigration.java

示例9: callDesk

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Override
protected DeskBaseResponse<ApiResponse<D>> callDesk(DeskUtil du)
{
    // get a service
    CustomerService service = du.getDeskClient().customers();
    Response<ApiResponse<Customer>> resp = null;
    try
    {
        if (!delta)
        {
            // false == bigCompanies TODO
            resp = service.getCustomers(lastRecordId, DESK_PAGE_SIZE_CUSTOMER, page, "id", SortDirection.ASC,
                    (false ? Fields.include("id", "_links") : null)).execute();
        }
        else
        {
            resp = service.searchCustomersByUpdatedAt(updatedAt, DESK_PAGE_SIZE_CUSTOMER, page, "updated_at",
                SortDirection.ASC, (false ? Fields.include("updated_at", "_links") : null)).execute();
        }

    }
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    DeskBaseResponse<ApiResponse<D>> d = new DeskBaseResponse<>();
    d.errorCode = resp.code();
    d.setIsSuccess(resp.isSuccess());
    d.body = (ApiResponse<D>) resp.body();
    d.setHeaders(resp.headers());
    d.setMessage(resp.message());

    return d;
}
 
开发者ID:forcedotcom,项目名称:scmt-server,代码行数:36,代码来源:DeskContactMigration.java

示例10: callDesk

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Override
protected DeskBaseResponse<ApiResponse<D>> callDesk(DeskUtil du)
{

    // get a service
    CompanyService service = du.getDeskClient().companies();
    Response<ApiResponse<Company>> resp = null;

    // set the starting timestamp filter
    minTime = (delta ? updatedAt : (lastRecordId == 1 ? 1 : lastRecordId));

    // get the current timestamp so we have an upper boundary
    now = (int) (Calendar.getInstance().getTime().getTime() / 1000);

    try
    {
        resp = service
            .searchCompanies(String.format("(%s:[%d TO %d])", (delta ? "updated_at" : "created_at"), minTime, now),
                DESK_PAGE_SIZE_COMPANY, page, "created_at", SortDirection.ASC)
            .execute();

    }
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    DeskBaseResponse<ApiResponse<D>> d = new DeskBaseResponse<>();
    d.errorCode = resp.code();
    d.setIsSuccess(resp.isSuccess());
    d.body = (ApiResponse<D>) resp.body();
    d.setHeaders(resp.headers());
    d.setMessage(resp.message());

    return d;
}
 
开发者ID:forcedotcom,项目名称:scmt-server,代码行数:37,代码来源:DeskAccountMigration.java

示例11: setUp

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    articleProvider = new ArticleProvider(mockArticleService);
    callback = mock(ArticleCallbacks.class);

    when(mockArticleService.searchArticles(
            anyString(),
            anyInt(),
            anyInt(),
            any(TopicIds.class), // testing that this is null
            any(BrandIds.class),
            anyBoolean(),
            anyString(),
            any(SortDirection.class),
            anyString())).thenReturn(mock(Call.class));

    when(mockArticleService.getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            eq(true), // testing that this is true
            any(TopicIds.class),
            any(BrandIds.class),
            anyString(),
            any(SortDirection.class))).thenReturn(mock(Call.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:28,代码来源:ArticleProviderTest.java

示例12: getArticlesDoesNotPassTopicIdForAllTopics

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesDoesNotPassTopicIdForAllTopics() throws Exception {
    articleProvider.getArticles(ALL_TOPICS, ALL_BRANDS, 1, callback);
    verify(mockArticleService).getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            anyBoolean(),
            isNull(TopicIds.class), // testing that this is null
            any(BrandIds.class),
            anyString(),
            any(SortDirection.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:14,代码来源:ArticleProviderTest.java

示例13: getArticlesDoesPassTopicId

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesDoesPassTopicId() throws Exception {
    articleProvider.getArticles(1, ALL_BRANDS, 1, callback);
    verify(mockArticleService).getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            anyBoolean(),
            isNotNull(TopicIds.class), // testing that this is not null
            any(BrandIds.class),
            anyString(),
            any(SortDirection.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:14,代码来源:ArticleProviderTest.java

示例14: getArticlesDoesNotPassBrandIdForAllBrands

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesDoesNotPassBrandIdForAllBrands() throws Exception {
    articleProvider.getArticles(ALL_TOPICS, ALL_BRANDS, 1, callback);
    verify(mockArticleService).getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            anyBoolean(),
            any(TopicIds.class),
            isNull(BrandIds.class), // testing that this is null
            anyString(),
            any(SortDirection.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:14,代码来源:ArticleProviderTest.java

示例15: getArticlesDoesPassBrandId

import com.desk.java.apiclient.model.SortDirection; //导入依赖的package包/类
@Test
public void getArticlesDoesPassBrandId() throws Exception {
    articleProvider.getArticles(ALL_TOPICS, 1, 1, callback);
    verify(mockArticleService).getArticles(
            anyString(),
            anyInt(),
            anyInt(),
            anyBoolean(),
            any(TopicIds.class),
            isNotNull(BrandIds.class), // testing that this is null
            anyString(),
            any(SortDirection.class));
}
 
开发者ID:forcedotcom,项目名称:DeskMobileSDK-Android,代码行数:14,代码来源:ArticleProviderTest.java


注:本文中的com.desk.java.apiclient.model.SortDirection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。