本文整理匯總了Java中com.google.common.base.Functions.compose方法的典型用法代碼示例。如果您正苦於以下問題:Java Functions.compose方法的具體用法?Java Functions.compose怎麽用?Java Functions.compose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.base.Functions
的用法示例。
在下文中一共展示了Functions.compose方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createResponseMatchingStrategy
import com.google.common.base.Functions; //導入方法依賴的package包/類
private static ImmutableList<ResponseToEREAlignmentRule> createResponseMatchingStrategy(
Optional<CoreNLPDocument> coreNLPDoc) {
final ImmutableList.Builder<ResponseToEREAlignmentRule> ret = ImmutableList.builder();
// if a CoreNLP analysis is available, we can use it to compute heads for both system and ERE
// objects.
final Function<Response, OffsetRange<CharOffset>> responseComputedHead;
final Function<CandidateAlignmentTarget, OffsetRange<CharOffset>> ereComputedHead;
if (coreNLPDoc.isPresent()) {
final CoreNLPHeadExtractor coreNLPHeadExtractor = CoreNLPHeadExtractor.of(coreNLPDoc.get());
responseComputedHead = Functions.compose(coreNLPHeadExtractor, CasExtractor.INSTANCE);
ereComputedHead = Functions.compose(coreNLPHeadExtractor, ERE_HEAD_IF_DECLARED);
} else {
responseComputedHead = CasExtractor.INSTANCE;
ereComputedHead = ERE_HEAD_IF_DECLARED;
}
ret.addAll(ImmutableList.of(
// response CAS matches ERE extent exactly
new SpansMatchExactly(CasExtractor.INSTANCE, offsets()),
// response CAS matches ERE declared head exactly
new SpansMatchExactly(CasExtractor.INSTANCE, ERE_HEAD_IF_DECLARED),
// response CAS matches ERE computed head exactly
new SpansMatchExactly(CasExtractor.INSTANCE, ereComputedHead),
// response CAS head matches ERE extent exactly
new SpansMatchExactly(responseComputedHead, offsets()),
// response CAS head matches ERE declared head exactly
new SpansMatchExactly(responseComputedHead, ERE_HEAD_IF_DECLARED),
// response CAS head matches ERE computed head exactly
new SpansMatchExactly(responseComputedHead, ereComputedHead),
// finally we do a more aggressive alignment attempt by containment
new ContainmentSpanChecker(CasExtractor.INSTANCE, responseComputedHead)
));
return ret.build();
}
示例2: build
import com.google.common.base.Functions; //導入方法依賴的package包/類
public HiveDifferences build() {
checkNotNull(diffListener, "diffListener is required");
checkNotNull(comparatorRegistry, "comparatorRegistry is required");
checkNotNull(sourceConfiguration, "sourceConfiguration is required");
checkNotNull(sourceTable, "sourceTable is required");
checkNotNull(sourcePartitionIterator, "sourcePartitionIterable is required");
if (replicaTable.isPresent() && !replicaPartitionFetcher.isPresent()) {
throw new IllegalStateException("replicaPartitionFetcher is required if replicaTable exists");
}
if (checksumFunction == null) {
checksumFunction = Functions.compose(new PathDigest(), new PathToPathMetadata(sourceConfiguration));
}
return new HiveDifferences(comparatorRegistry, diffListener, sourceTable, sourcePartitionIterator, replicaTable,
replicaPartitionFetcher, checksumFunction);
}
示例3: InitializeRelyingPartyContext
import com.google.common.base.Functions; //導入方法依賴的package包/類
/** Constructor. */
public InitializeRelyingPartyContext() {
relyingPartyContextCreationStrategy = new ChildContextLookup<>(RelyingPartyContext.class, true);
oidcMetadataContextLookupStrategy = Functions.compose(new ChildContextLookup<>(OIDCMetadataContext.class),
new InboundMessageContextLookup());
}
示例4: AddClaimsToIDToken
import com.google.common.base.Functions; //導入方法依賴的package包/類
/** Constructor. */
AddClaimsToIDToken() {
attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
new ChildContextLookup<ProfileRequestContext, RelyingPartyContext>(RelyingPartyContext.class));
}
示例5: checksumFunction
import com.google.common.base.Functions; //導入方法依賴的package包/類
@Profile({ Modules.REPLICATION })
@Bean
Function<Path, String> checksumFunction(HiveConf sourceHiveConf) {
return Functions.compose(new PathDigest(), new PathToPathMetadata(sourceHiveConf));
}