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


Java Tuple2.v1方法代码示例

本文整理汇总了Java中org.jooq.lambda.tuple.Tuple2.v1方法的典型用法代码示例。如果您正苦于以下问题:Java Tuple2.v1方法的具体用法?Java Tuple2.v1怎么用?Java Tuple2.v1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jooq.lambda.tuple.Tuple2的用法示例。


在下文中一共展示了Tuple2.v1方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetAPIKeysBitfinex

import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
@Test
public void testGetAPIKeysBitfinex() {
    when(config.getString("bitfinex.apiKey")).thenReturn("API_KEY");
    when(config.getString("bitfinex.apiSecretKey"))
            .thenReturn("API_SECRET_KEY");

    configReader.setConfig(config);

    Tuple2<String, String> apiKeys = configReader.getAPIKeys("bitfinex");
    String apiKey = apiKeys.v1();
    String apiSecretKey = apiKeys.v2();

    verify(config).getString("bitfinex.apiKey");
    verify(config).getString("bitfinex.apiSecretKey");

    verify(config, times(2)).getString(anyString());

    assertEquals("API_KEY", apiKey);
    assertEquals("API_SECRET_KEY", apiSecretKey);
}
 
开发者ID:KosherBacon,项目名称:JavaBitcoinTrader,代码行数:21,代码来源:ConfigReaderTest.java

示例2: testGetAPIKeysBTC_E

import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
@Test
public void testGetAPIKeysBTC_E() {
    when(config.getString("btce.apiKey")).thenReturn("API_KEY");
    when(config.getString("btce.apiSecretKey"))
            .thenReturn("API_SECRET_KEY");

    configReader.setConfig(config);

    Tuple2<String, String> apiKeys = configReader.getAPIKeys("BTC-E");
    String apiKey = apiKeys.v1();
    String apiSecretKey = apiKeys.v2();

    verify(config).getString("btce.apiKey");
    verify(config).getString("btce.apiSecretKey");

    verify(config, times(2)).getString(anyString());

    assertEquals("API_KEY", apiKey);
    assertEquals("API_SECRET_KEY", apiSecretKey);
}
 
开发者ID:KosherBacon,项目名称:JavaBitcoinTrader,代码行数:21,代码来源:ConfigReaderTest.java

示例3: reactivateSession

import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
private static void reactivateSession(
    Fsm fsm,
    OpcUaSession session,
    CompletableFuture<OpcUaSession> sessionFuture) {

    OpcUaClient client = fsm.getClient();
    UaTcpStackClient stackClient = client.getStackClient();

    Function<ClientSecureChannel, CompletionStage<ActivateSessionResponse>> activate = secureChannel -> {
        try {
            EndpointDescription endpoint = stackClient.getEndpoint().orElseThrow(
                () -> new Exception("cannot create session with no endpoint configured"));

            Tuple2<UserIdentityToken, SignatureData> tuple =
                client.getConfig().getIdentityProvider()
                    .getIdentityToken(endpoint, session.getServerNonce());

            UserIdentityToken userIdentityToken = tuple.v1();
            SignatureData userTokenSignature = tuple.v2();

            SignatureData clientSignature = buildClientSignature(
                secureChannel,
                session.getServerNonce()
            );

            ActivateSessionRequest request = new ActivateSessionRequest(
                client.newRequestHeader(session.getAuthenticationToken(), REQUEST_TIMEOUT),
                clientSignature,
                new SignedSoftwareCertificate[0],
                new String[0],
                ExtensionObject.encode(userIdentityToken),
                userTokenSignature
            );

            LOGGER.debug(
                "Sending (re)ActivateSessionRequest, secureChannelId={}, channel={}...",
                secureChannel.getChannelId(), secureChannel.getChannel());

            return stackClient.sendRequest(request);
        } catch (Exception e) {
            return failedFuture(e);
        }
    };

    stackClient.getChannelFuture().thenCompose(activate).whenCompleteAsync((asr, ex) -> {
        if (asr != null) {
            LOGGER.debug("Session reactivated: {}", session);

            session.setServerNonce(asr.getServerNonce());

            fsm.fireEvent(new ReactivateSuccessEvent(session, sessionFuture));
        } else {
            LOGGER.debug("(re)ActivateSession failed: {}", session, ex);

            fsm.fireEvent(new ReactivateFailureEvent(ex, session, sessionFuture));
        }
    }, stackClient.getExecutorService());
}
 
开发者ID:eclipse,项目名称:milo,代码行数:59,代码来源:AbstractSessionState.java

示例4: MomentumStrategy

import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
private MomentumStrategy(Tuple2<Rule, Rule> rules) {
    super(rules.v1(), rules.v2());
}
 
开发者ID:KosherBacon,项目名称:JavaBitcoinTrader,代码行数:4,代码来源:MomentumStrategy.java

示例5: BasicStrategy

import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
private BasicStrategy(Tuple2<Rule, Rule> rules) {
    super(rules.v1(), rules.v2());
}
 
开发者ID:KosherBacon,项目名称:JavaBitcoinTrader,代码行数:4,代码来源:BasicStrategy.java


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