當前位置: 首頁>>代碼示例>>Java>>正文


Java Predicates.alwaysFalse方法代碼示例

本文整理匯總了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();
}
 
開發者ID:CSCfi,項目名稱:shibboleth-idp-oidc-extension,代碼行數:15,代碼來源:OIDCCoreProtocolConfiguration.java

示例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());
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:11,代碼來源:MapsTest.java

示例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;
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:12,代碼來源:CraftiniumForgeTileEntity.java

示例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);
}
 
開發者ID:OWASP,項目名稱:url-classifier,代碼行數:17,代碼來源:FragmentClassifierBuilder.java

示例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);
}
 
開發者ID:OWASP,項目名稱:url-classifier,代碼行數:43,代碼來源:AuthorityClassifierBuilder.java

示例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;
}
 
開發者ID:OWASP,項目名稱:url-classifier,代碼行數:18,代碼來源:AuthorityClassifierBuilder.java

示例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;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:36,代碼來源:EntitySelectors.java

示例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;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:9,代碼來源:TF2Attribute.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:36,代碼來源:EntitySelectors.java

示例10: unassessedFilter

import com.google.common.base.Predicates; //導入方法依賴的package包/類
@Override
public Predicate<Response> unassessedFilter() {
  return Predicates.alwaysFalse();
}
 
開發者ID:isi-nlp,項目名稱:tac-kbp-eal,代碼行數:5,代碼來源:LocatePossibleAssessmentMistakes.java

示例11: unassessedFilter

import com.google.common.base.Predicates; //導入方法依賴的package包/類
@Override
public Predicate<Response> unassessedFilter() {
  // unassessed answers cannot be linked
  return Predicates.alwaysFalse();
}
 
開發者ID:isi-nlp,項目名稱:tac-kbp-eal,代碼行數:6,代碼來源:LinkableResponseFilter2015ForGold.java

示例12: Context

import com.google.common.base.Predicates; //導入方法依賴的package包/類
public Context(int expectedNumRelations) {
    this(expectedNumRelations, Predicates.<Symbol>alwaysFalse());
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:4,代碼來源:FieldCollectingVisitor.java

示例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);
}
 
開發者ID:OWASP,項目名稱:url-classifier,代碼行數:51,代碼來源:QueryClassifierBuilder.java


注:本文中的com.google.common.base.Predicates.alwaysFalse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。