Checks if a {@link AttributeAccess.Flag special purpose flag} has been recorded as relevant to the attribute
@param flag the flag
@return a builder that can be used to continue building the attribute definition
166527
@SuppressWarnings({"deprecation", "WeakerAccess"})
    protected boolean isFlagPresent(final AttributeAccess.Flag flag) {
        if (flags == null) { return false; }
        for (AttributeAccess.Flag f : flags) {
            if (f.equals(flag)) { return true; }
        }
        return false;
    }
32871
protected Boolean isResponsible(int flags) {

        if ((flags & CmsAccessControlEntry.ACCESS_FLAGS_RESPONSIBLE) > 0) {
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }
164458
public boolean isAttrFlagSet(String name, int flags)
    {
        return (null != m_attrs)
            ? ((m_attrs.getIgnoreCase(name) & flags) != 0)
            : false;
    }
509379
public boolean isRobotFlagSet(char flag) {
		String flags = getRobotFlags();
		return flags != null && flags.indexOf(flag) >= 0;
	}
161501
@CheckReturnValue
  public static Description.Builder buildDescriptionFromChecker(Tree node, BugChecker checker) {
    return Description.builder(
        Preconditions.checkNotNull(node),
        checker.canonicalName(),
        checker.linkUrl(),
        checker.defaultSeverity(),
        checker.message());
  }
520012
public Message setFlag(Flag ... flags) {
        if(flags != null) {
            short tmp=this.flags;
            for(Flag flag : flags) {
                if(flag != null)
                    tmp|=flag.value();
            }
            this.flags=tmp;
        }
        return this;
    }
443309
@Nonnull
	public static LBoolToSrtFunction boolToSrtFunctionFrom(Consumer<LBoolToSrtFunctionBuilder> buildingFunction) {
		LBoolToSrtFunctionBuilder builder = new LBoolToSrtFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1277683
Optional<Builder> getBuilder() {
    Optional<TypeElement> builderTypeElement = Optional.empty();
    for (TypeElement containedClass : ElementFilter.typesIn(autoValueClass.getEnclosedElements())) {
      if (hasAnnotationMirror(containedClass, AUTO_VALUE_BUILDER_NAME)) {
        if (!CLASS_OR_INTERFACE.contains(containedClass.getKind())) {
          errorReporter.reportError(
              "@AutoValue.Builder can only apply to a class or an interface", containedClass);
        } else if (!containedClass.getModifiers().contains(Modifier.STATIC)) {
          errorReporter.reportError(
              "@AutoValue.Builder cannot be applied to a non-static class", containedClass);
        } else if (builderTypeElement.isPresent()) {
          errorReporter.reportError(
              autoValueClass + " already has a Builder: " + builderTypeElement.get(),
              containedClass);
        } else {
          builderTypeElement = Optional.of(containedClass);
        }
      }
    }

    if (builderTypeElement.isPresent()) {
      return builderFrom(builderTypeElement.get());
    } else {
      return Optional.empty();
    }
  }
62196
private boolean isSpecialFlagSet(final OptionSet parsedArguments, final String flagName){
        if (parsedArguments.has(flagName)){
            Object value = parsedArguments.valueOf(flagName);
            return  (value == null || !value.equals("false"));
        } else{
            return false;
        }
    }
942090
@Override
    public Q addFlag(Position position, String flag) {
        return queryMixin.addFlag(new QueryFlag(position, flag));
    }
603174
public static int buildRegexFlags(final PatternFlag[] flags) {
        
        int intFlag = 0;
        for(PatternFlag flag : flags) {
            intFlag = intFlag | flag.getValue();
        }
        
        return intFlag;
        
    }
1317064
private Optional<Builder> builderFrom(TypeElement builderTypeElement) {

    // We require the builder to have the same type parameters as the @AutoValue class, meaning the
    // same names and bounds. In principle the type parameters could have different names, but that
    // would be confusing, and our code would reject it anyway because it wouldn't consider that
    // the return type of Foo<U> build() was really the same as the declaration of Foo<T>. This
    // check produces a better error message in that case and similar ones.

    if (!sameTypeParameters(autoValueClass, builderTypeElement)) {
      errorReporter.reportError(
          "Type parameters of "
              + builderTypeElement
              + " must have same names and bounds as "
              + "type parameters of "
              + autoValueClass,
          builderTypeElement);
      return Optional.empty();
    }
    return Optional.of(new Builder(builderTypeElement));
  }
433820
@Deprecated
    public static boolean isConcrete(XMethod xmethod) {
        int accessFlags = xmethod.getAccessFlags();
        return (accessFlags & Const.ACC_ABSTRACT) == 0 && (accessFlags & Const.ACC_NATIVE) == 0;
    }
845190
public void setRobotFlag(char flag) {
		String flags = getRobotFlags();
		if (flags == null) {
			setRobotFlags(Character.toString(flag));
		} else {
			if (flags.indexOf(flag) < 0) {
				setRobotFlags(flags + flag);
			}
		}
	}
616023
private boolean hasToBuilderMethod(
      DeclaredType builder,
      boolean isExtensible,
      Iterable<ExecutableElement> methods) {
    for (ExecutableElement method : methods) {
      if (isToBuilderMethod(builder, method)) {
        if (!isExtensible) {
          messager.printMessage(ERROR,
              "No accessible no-args Builder constructor available to implement toBuilder",
              method);
        }
        return true;
      }
    }
    return false;
  }
802442
private boolean methodIsStaticBuilder(DetailAST methodToken) {
        DetailAST modifierToken = methodToken.findFirstToken(TokenTypes.MODIFIERS);
        if (modifierToken == null) {
            return false;
        }

        if (modifierToken.findFirstToken(TokenTypes.LITERAL_STATIC) == null
            || modifierToken.findFirstToken(TokenTypes.LITERAL_PUBLIC) == null) {
            return false;
        }

        return methodToken.findFirstToken(TokenTypes.IDENT).getText().equals(BUILDER_METHOD_NAME);
    }
280359
@Nonnull
	public static LBoolToDblFunction boolToDblFunctionFrom(Consumer<LBoolToDblFunctionBuilder> buildingFunction) {
		LBoolToDblFunctionBuilder builder = new LBoolToDblFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}