see {@link javax.tools.OptionChecker#isSupportedOption(String)}
320654
public static int isSupportedOption(String option) {
    boolean isSupported =
        option.startsWith(SEVERITY_PREFIX)
            || option.startsWith(ErrorProneFlags.PREFIX)
            || option.startsWith(PATCH_OUTPUT_LOCATION)
            || option.startsWith(PATCH_CHECKS_PREFIX)
            || option.startsWith(EXCLUDED_PATHS_PREFIX)
            || option.equals(IGNORE_UNKNOWN_CHECKS_FLAG)
            || option.equals(DISABLE_WARNINGS_IN_GENERATED_CODE_FLAG)
            || option.equals(ERRORS_AS_WARNINGS_FLAG)
            || option.equals(ENABLE_ALL_CHECKS)
            || option.equals(DISABLE_ALL_CHECKS)
            || option.equals(IGNORE_SUPPRESSION_ANNOTATIONS)
            || option.equals(COMPILING_TEST_ONLY_CODE);
    return isSupported ? 0 : -1;
  }
986702
public static boolean isConversionEnabled(String conversionMode) {

        boolean value = true;
        if ((conversionMode == null) || (conversionMode.indexOf(PARAM_DISABLED) != -1)) {
            value = false;
        }
        return value;
    }
1254337
public static boolean containsOption(final List<?> options, final Object findOption) {
		if (options != null) {
			for (Object option : options) {
				if (option instanceof OptionGroup) {
					List<?> groupOptions = ((OptionGroup) option).getOptions();
					if (groupOptions != null) {
						for (Object nestedOption : groupOptions) {
							if (Util.equals(nestedOption, findOption)) {
								return true;
							}
						}
					}
				} else if (Util.equals(option, findOption)) {
					return true;
				}
			}
		}
		return false;
	}
1245513
@SuppressWarnings("unchecked")
    public static <T extends Enum & Option> T recognizeOption(final String option) {
        final Enum res = StringConverter.convert(Enum.class, option);
        Preconditions.checkState(Option.class.isAssignableFrom(res.getDeclaringClass()),
                "%s is not an option type (must be enum and implement Option interface)",
                res.getDeclaringClass());
        return (T) res;
    }
431557
public boolean isDownOptional() {
        int i;
        int max;
        Alternative ab;

        max = alternatives.size();
        for (i = 0; i < max; i++) {
            ab = alternatives.get(i);
            if (ab.getArgCount() == 0) {
                return true;
            }
        }
        return false;
    }
105107
public boolean readOptions() {
	String filename = modelDir + File.separator + optionFile;
	BufferedReader fin = null;
	String line;
	
	try {
	    fin = new BufferedReader(new FileReader(filename));

	    System.out.println("Reading options ...");
	    	    
	    // read option lines
	    while ((line = fin.readLine()) != null) {
		String trimLine = line.trim();
		if (trimLine.startsWith("#")) {
		    // comment line
		    continue;
		}
		
		StringTokenizer strTok = new StringTokenizer(line, "= \t\r\n");
		int len = strTok.countTokens();
		if (len != 2) {
		    // invalid parameter line, ignore it
		    continue;
		}
		
		String strOpt = strTok.nextToken();
		String strVal = strTok.nextToken();
		
		if (strOpt.compareToIgnoreCase("order") == 0) {
		    int numTemp = Integer.parseInt(strVal);
		    order = numTemp;
		}		
	    }
	    
	    System.out.println("Reading options completed!");
	
	} catch (IOException e) {
	    System.out.println("Couldn't open and read option file: " + optionFile);
	    System.out.println(e.toString());
	    return false;
	}
	
	return true;	
    }
712897
public boolean isSet(final Enum option) {
        final OptionHolder holder = options.getHolder(option);
        return holder != null && holder.isSet();
    }
915909
boolean hasOption(String opt) {
        Boolean has = options.get(opt);
        if (has == null) {
            throw new InternalError("hasOption called before allowedOptions or on bad option");
        }
        return has;
    }
684980
private static boolean isSupported(final File file)
        {
        final String extension = FilenameUtils.getExtension(file.getName());
        if (StringUtils.isBlank(extension))
            {
            return false;
            }
        
        final String[] types = 
            {
            "mp3", "aif", "aiff", "wav", "mp2", "mp4",
            "aac", "mid", "m4a", "m4p", "ogg"
            };
        if (ArrayUtils.contains(types, extension.toLowerCase()))
            {
            return true;
            }
        return false;
        }
797312
public void setOptional(boolean optional) {
    if (field.getType().isPrimitive() || field.isAnnotationPresent(Version.class)
        || field.isAnnotationPresent(CreatedTimestamp.class)
        || field.isAnnotationPresent(UpdatedTimestamp.class)) {
      this.optional = false;
    } else {
      this.optional = optional;
    }
  }
682767
public static <T> void verifyDeprecatedOption(String deprecatedOption, T value, String option) {
        if (value != null) {
            LOGGER.warn("The option '" + deprecatedOption + "' is deprecated, use '" + option + "' instead.");
        }
    }
1250456
def _has_exclusive_option(cls, options):
        """"""
        return any([getattr(options, opt) is not None for opt in
                    cls.BASE_ERROR_SELECTION_OPTIONS])
1163937
public boolean hasOption(String opt)
    {
        opt = Util.stripLeadingHyphens(opt);

        return shortOpts.containsKey(opt) || longOpts.containsKey(opt);
    }
224649
public boolean hasOption(final String optionName) {
        if (optionName.length() == 1) {
            return hasOption(optionName.charAt(0));
        }
        return commandLine.hasOption("--" + optionName);
    }
1053942
static <T> boolean setOption(Channel jdkChannel, NioChannelOption<T> option, T value) {
        java.nio.channels.NetworkChannel channel = (java.nio.channels.NetworkChannel) jdkChannel;
        if (!channel.supportedOptions().contains(option.option)) {
            return false;
        }
        if (channel instanceof ServerSocketChannel && option.option == java.net.StandardSocketOptions.IP_TOS) {
            // Skip IP_TOS as a workaround for a JDK bug:
            // See http://mail.openjdk.java.net/pipermail/nio-dev/2018-August/005365.html
            return false;
        }
        try {
            channel.setOption(option.option, value);
            return true;
        } catch (IOException e) {
            throw new ChannelException(e);
        }
    }
136910
protected void checkOption(CliOptionContainer optionContainer) {

    CliOption option = optionContainer.getOption();
    String mode = option.mode();
    if (this.cliState.getMode(mode) == null) {
      handleUndefinedMode(optionContainer);
    }

    checkOptionName(option.name(), optionContainer);
    for (String alias : option.aliases()) {
      checkOptionName(alias, optionContainer);
    }
  }
1196225
public boolean handleOptions(Map<Option, String> map) {
        boolean ok = true;
        for (Map.Entry<Option, String> e: map.entrySet()) {
            try {
                ok = ok & handleOption(e.getKey(), e.getValue());
            } catch (IllegalArgumentException ex) {
                log.error(Errors.IllegalArgumentForOption(e.getKey().getPrimaryName(), ex.getMessage()));
                ok = false;
            }
        }
        return ok;
    }