本文整理匯總了Java中com.google.common.base.Predicates.alwaysFalse方法的典型用法代碼示例。如果您正苦於以下問題:Java Predicates.alwaysFalse方法的具體用法?Java Predicates.alwaysFalse怎麽用?Java Predicates.alwaysFalse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.base.Predicates
的用法示例。
在下文中一共展示了Predicates.alwaysFalse方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: OIDCCoreProtocolConfiguration
import com.google.common.base.Predicates; //導入方法依賴的package包/類
/**
* Creates a new configuration instance.
*
* @param profileId Unique profile identifier.
*/
public OIDCCoreProtocolConfiguration(@Nonnull @NotEmpty final String profileId) {
super(profileId);
authenticationFlows = Collections.emptySet();
postAuthenticationFlows = Collections.emptyList();
defaultAuthenticationContexts = Collections.emptyList();
nameIDFormatPrecedence = Collections.emptyList();
signIDTokensPredicate = Predicates.alwaysTrue();
pairwiseSubject = Predicates.alwaysFalse();
}
示例2: testFilteredEntriesObjectPredicate
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public void testFilteredEntriesObjectPredicate() {
Map<String, Integer> unfiltered = createUnfiltered();
unfiltered.put("cat", 3);
unfiltered.put("dog", 2);
unfiltered.put("horse", 5);
Predicate<Object> predicate = Predicates.alwaysFalse();
Map<String, Integer> filtered
= Maps.filterEntries(unfiltered, predicate);
assertTrue(filtered.isEmpty());
}
示例3: CraftiniumForgeTileEntity
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public CraftiniumForgeTileEntity() {
this.input = new ItemStackHandler(1);
this.output = new SelectiveItemStackHandler(1, Predicates.alwaysFalse());
this.fuel = new SelectiveItemStackHandler(1, TileEntityFurnace::isItemFuel);
this.furnaceBurnTime = 0;
this.currentItemBurnTime = 0;
this.cookTime = 0;
this.totalCookTime = 0;
this.divisor = 1;
this.brokenByCreative = false;
}
示例4: build
import com.google.common.base.Predicates; //導入方法依賴的package包/類
/**
* Builds a classifier based on previous allow/match decisions.
* This may be reused after a call to build and subsequent calls to
* allow/match methods will not affect previously built classifiers.
*/
public FragmentClassifier build() {
Predicate<? super Optional<String>> fragmentClassifier = this.fragmentPred;
UrlClassifier asRelativeUrlClassifier = this.asRelativeUrlPred;
if (fragmentClassifier == null) {
fragmentClassifier = Predicates.alwaysFalse();
}
if (asRelativeUrlClassifier == null) {
asRelativeUrlClassifier = MATCH_NO_URLS;
}
return new FragmentClassifierImpl(fragmentClassifier, asRelativeUrlClassifier);
}
示例5: build
import com.google.common.base.Predicates; //導入方法依賴的package包/類
/**
* Builds a classifier based on previous allow/match decisions.
* This may be reused after a call to build and subsequent calls to
* allow/match methods will not affect previously built classifiers.
*/
public AuthorityClassifier build() {
ImmutableSet<Inet4Address> ipv4Set = ipv4s.build();
ImmutableSet<Inet6Address> ipv6Set = ipv6s.build();
ImmutableSet<InternetDomainName> domainNameSet = domainNames.build();
HostGlobMatcher hostGlobMatcher = new HostGlobMatcher(hostGlobs.build());
int[] allowedPortsSorted;
{
ImmutableSet<Integer> allowedPortIntSet = allowedPorts.build();
int n = allowedPortIntSet.size();
allowedPortsSorted = new int[n];
Iterator<Integer> allowedPortIt = allowedPortIntSet.iterator();
for (int i = 0; i < n; ++i) {
allowedPortsSorted[i] = allowedPortIt.next();
}
Arrays.sort(allowedPortsSorted);
}
Predicate<? super Integer> portClassifier =
allowedPortsSorted.length == 0 // No exclusion specified
? Predicates.alwaysTrue()
: Predicates.alwaysFalse();
if (this.allowedPortClassifier != null) {
portClassifier = this.allowedPortClassifier;
}
UserInfoClassifier userInfoClassifier =
this.allowedUserInfoClassifier != null
? this.allowedUserInfoClassifier
: UserInfoClassifiers.NO_PASSWORD_BUT_USERNAME_IF_ALLOWED_BY_SCHEME;
return new AuthorityClassifierImpl(
ipv4Set,
ipv6Set,
domainNameSet,
hostGlobMatcher,
matchesAnyHost,
allowedPortsSorted,
portClassifier,
userInfoClassifier);
}
示例6: port
import com.google.common.base.Predicates; //導入方法依賴的package包/類
/**
* If a port matcher is specified we assume default ports based on
* scheme, so matching ports (80, 443) matches http://example.com/
* but not https://example.com/ and https://example.com:80/ but not
* https://example.com:10000/
*/
public AuthorityClassifierBuilder port(
Predicate<? super Integer> portIsAllowed) {
Preconditions.checkNotNull(portIsAllowed);
if (allowedPortClassifier == null) {
allowedPortClassifier = portIsAllowed;
} else if (portIsAllowed != Predicates.alwaysFalse()) { // x || false -> x
allowedPortClassifier = Predicates.or(
allowedPortClassifier, portIsAllowed);
}
return this;
}
示例7: getTeamCollisionPredicate
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public static <T extends Entity> Predicate<T> getTeamCollisionPredicate(final Entity entityIn)
{
final Team team = entityIn.getTeam();
final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule();
Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>()
{
public boolean apply(@Nullable Entity p_apply_1_)
{
if (!p_apply_1_.canBePushed())
{
return false;
}
else if (!entityIn.world.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser())
{
Team team1 = p_apply_1_.getTeam();
Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule();
if (team$collisionrule1 == Team.CollisionRule.NEVER)
{
return false;
}
else
{
boolean flag = team != null && team.isSameTeam(team1);
return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag;
}
}
else
{
return false;
}
}
});
return (Predicate<T>)ret;
}
示例8: getAllPassibleAttributesForUpgradeStation
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public static List<TF2Attribute> getAllPassibleAttributesForUpgradeStation() {
List<TF2Attribute> list = new ArrayList<>();
for (TF2Attribute attr : attributes)
if (attr != null && attr.canApply != Predicates.<ItemStack>alwaysFalse() && attr.state == State.POSITIVE)
for (int i = 0; i < attr.weight; i++)
list.add(attr);
return list;
}
示例9: getTeamCollisionPredicate
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public static <T extends Entity> Predicate<T> getTeamCollisionPredicate(final Entity entityIn)
{
final Team team = entityIn.getTeam();
final Team.CollisionRule team$collisionrule = team == null ? Team.CollisionRule.ALWAYS : team.getCollisionRule();
Predicate<?> ret = team$collisionrule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : Predicates.and(NOT_SPECTATING, new Predicate<Entity>()
{
public boolean apply(@Nullable Entity p_apply_1_)
{
if (!p_apply_1_.canBePushed())
{
return false;
}
else if (!entityIn.worldObj.isRemote || p_apply_1_ instanceof EntityPlayer && ((EntityPlayer)p_apply_1_).isUser())
{
Team team1 = p_apply_1_.getTeam();
Team.CollisionRule team$collisionrule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule();
if (team$collisionrule1 == Team.CollisionRule.NEVER)
{
return false;
}
else
{
boolean flag = team != null && team.isSameTeam(team1);
return (team$collisionrule == Team.CollisionRule.HIDE_FOR_OWN_TEAM || team$collisionrule1 == Team.CollisionRule.HIDE_FOR_OWN_TEAM) && flag ? false : team$collisionrule != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS && team$collisionrule1 != Team.CollisionRule.HIDE_FOR_OTHER_TEAMS || flag;
}
}
else
{
return false;
}
}
});
return (Predicate<T>)ret;
}
示例10: unassessedFilter
import com.google.common.base.Predicates; //導入方法依賴的package包/類
@Override
public Predicate<Response> unassessedFilter() {
return Predicates.alwaysFalse();
}
示例11: unassessedFilter
import com.google.common.base.Predicates; //導入方法依賴的package包/類
@Override
public Predicate<Response> unassessedFilter() {
// unassessed answers cannot be linked
return Predicates.alwaysFalse();
}
示例12: Context
import com.google.common.base.Predicates; //導入方法依賴的package包/類
public Context(int expectedNumRelations) {
this(expectedNumRelations, Predicates.<Symbol>alwaysFalse());
}
示例13: build
import com.google.common.base.Predicates; //導入方法依賴的package包/類
/**
* Builds a classifier based on previous allow/match decisions.
* This may be reused after a call to build and subsequent calls to
* allow/match methods will not affect previously built classifiers.
*/
public QueryClassifier build() {
ImmutableSet<String> mayKeySet = mayKeys.build();
Predicate<? super String> mayKeyClassifier;
if (mayClassifier != null) {
mayKeyClassifier = mayClassifier;
} else if (mayKeySet.isEmpty()) {
// If nothing specified, assume permissive.
mayKeyClassifier = Predicates.alwaysTrue();
} else {
// If a set specified, defer to the set.
mayKeyClassifier = Predicates.<String>alwaysFalse();
}
ImmutableSet<String> onceKeySet = onceKeys.build();
Predicate<? super String> onceKeyClassifier;
if (onceClassifier != null) {
onceKeyClassifier = onceClassifier;
} else {
onceKeyClassifier = Predicates.<String>alwaysFalse();
}
ImmutableSet<String> mustKeySet = mustKeys.build();
ImmutableMap<String, Predicate<? super Optional<String>>> valueClassifierMap =
ImmutableMap.copyOf(valueClassifiers);
// If something may appear once or must appear, then it may appear.
if (!Predicates.alwaysTrue().equals(mayKeyClassifier)) {
if (!Predicates.alwaysFalse().equals(onceKeyClassifier)) {
mayKeyClassifier = Predicates.or(mayKeyClassifier, onceKeyClassifier);
}
mayKeySet = ImmutableSet.<String>builder()
.addAll(mayKeySet)
.addAll(onceKeySet)
.addAll(mustKeySet)
.build();
}
return new QueryClassifierImpl(
mayKeySet,
mayKeyClassifier,
onceKeySet,
onceKeyClassifier,
mustKeySet,
valueClassifierMap);
}