本文整理汇总了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));
}