本文整理汇总了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);
}
示例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);
}
示例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());
}
示例4: MomentumStrategy
import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
private MomentumStrategy(Tuple2<Rule, Rule> rules) {
super(rules.v1(), rules.v2());
}
示例5: BasicStrategy
import org.jooq.lambda.tuple.Tuple2; //导入方法依赖的package包/类
private BasicStrategy(Tuple2<Rule, Rule> rules) {
super(rules.v1(), rules.v2());
}