Converts from proto type to options.

@param existsOptions the proto options to convert
@return the converted proto options
15285
public static GetStatusPOptions toGetStatusOptions(ExistsPOptions existsOptions) {
    GetStatusPOptions.Builder getStatusOptionsBuilder = GetStatusPOptions.newBuilder();
    if (existsOptions.hasCommonOptions()) {
      getStatusOptionsBuilder.setCommonOptions(existsOptions.getCommonOptions());
    }
    if (existsOptions.hasLoadMetadataType()) {
      getStatusOptionsBuilder.setLoadMetadataType(existsOptions.getLoadMetadataType());
    }
    return getStatusOptionsBuilder.build();
  }
1103863
public Option[] discoverOptionsViaReflection() {
        //Class<? extends AbstractOptionHandler> c = this.getClass();
        Class c = this.handler.getClass();
        Field[] fields = c.getFields();
        List<Option> optList = new LinkedList<Option>();
        for (Field field : fields) {
            String fName = field.getName();
            Class<?> fType = field.getType();
            if (fType.getName().endsWith("Option")) {
                if (Option.class.isAssignableFrom(fType)) {
                    Option oVal = null;
                    try {
                        field.setAccessible(true);
                        oVal = (Option) field.get(this.handler);
                    } catch (IllegalAccessException ignored) {
                        // cannot access this field
                    }
                    if (oVal != null) {
                        optList.add(oVal);
                    }
                }
            }
        }
        return optList.toArray(new Option[optList.size()]);
    }
711519
public static ArgumentPredicate options(List<String> optionList) {
        return regex(Joiner.on("|").join(Lists.transform(optionList, new Function<String, String>() {
            @Override
            public String apply(String s) {
                return Pattern.quote(s);
            }
        })));
    }
634898
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.split( core_rspace ), function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
1304256
public final EventFilterParser.exists_predicate_return exists_predicate() throws RecognitionException {
        EventFilterParser.exists_predicate_return retval = new EventFilterParser.exists_predicate_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token EXISTS78=null;
        Token EXISTS79=null;
        EventFilterParser.path_function_return path_function77 =null;

        EventFilterParser.path_function_return path_function80 =null;


        CommonTree EXISTS78_tree=null;
        CommonTree EXISTS79_tree=null;
        RewriteRuleTokenStream stream_EXISTS=new RewriteRuleTokenStream(adaptor,"token EXISTS");
        RewriteRuleSubtreeStream stream_path_function=new RewriteRuleSubtreeStream(adaptor,"rule path_function");
        try {
            // EventFilter.g:160:2: ( path_function EXISTS -> ^( EXISTS path_function ) | EXISTS path_function -> ^( EXISTS path_function ) )
            int alt11=2;
            int LA11_0 = input.LA(1);

            if ( (LA11_0==XPATH_FUN_NAME) ) {
                alt11=1;
            }
            else if ( (LA11_0==EXISTS) ) {
                alt11=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 11, 0, input);

                throw nvae;

            }
            switch (alt11) {
                case 1 :
                    // EventFilter.g:160:4: path_function EXISTS
                    {
                    pushFollow(FOLLOW_path_function_in_exists_predicate940);
                    path_function77=path_function();

                    state._fsp--;

                    stream_path_function.add(path_function77.getTree());

                    EXISTS78=(Token)match(input,EXISTS,FOLLOW_EXISTS_in_exists_predicate942);
                    stream_EXISTS.add(EXISTS78);


                    // AST REWRITE
                    // elements: EXISTS, path_function
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 160:25: -> ^( EXISTS path_function )
                    {
                        // EventFilter.g:160:28: ^( EXISTS path_function )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        new ExistsTreeNode(stream_EXISTS.nextToken())
                        , root_1);

                        adaptor.addChild(root_1, stream_path_function.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // EventFilter.g:161:3: EXISTS path_function
                    {
                    EXISTS79=(Token)match(input,EXISTS,FOLLOW_EXISTS_in_exists_predicate959);
                    stream_EXISTS.add(EXISTS79);


                    pushFollow(FOLLOW_path_function_in_exists_predicate961);
                    path_function80=path_function();

                    state._fsp--;

                    stream_path_function.add(path_function80.getTree());

                    // AST REWRITE
                    // elements: path_function, EXISTS
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 161:24: -> ^( EXISTS path_function )
                    {
                        // EventFilter.g:161:27: ^( EXISTS path_function )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        new ExistsTreeNode(stream_EXISTS.nextToken())
                        , root_1);

                        adaptor.addChild(root_1, stream_path_function.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
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;
	}
1243160
public Configuration withOptions(Options options) {
        return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener);
    }
691265
@SuppressWarnings("JavadocReference")
    protected Map<String, Object> getNewOptionsByName(ResourceOptions options, Map<String, Object> optionsByName) {
        Map<String,Object> clonedOptionsByName = new HashMap<>(optionsByName);
        clonedOptionsByName.put(NEXT_PROTOCOL.name(), options.getOption(NEXT_PROTOCOL));
        clonedOptionsByName.put(QUALIFIER.name(), options.getOption(QUALIFIER));
        clonedOptionsByName.put(TRANSPORT_URI.name(), options.getOption(TRANSPORT_URI));
        clonedOptionsByName.put(BIND_ALTERNATE.name(), options.getOption(BIND_ALTERNATE));
        clonedOptionsByName.put(RESOLVER.name(), options.getOption(RESOLVER));

        return clonedOptionsByName;
    }
1202460
@Override
  public Object getOptProperty(final String name) throws OptionsException {
    if (useSystemwideValues) {
      return findValue(optionsRoot, makePathElements(name), -1);
    }

    return findValue(localOptionsRoot, makePathElements(name), -1);
  }
915607
@VisibleForTesting
  static BucketOptions createBucketOptions(
      @javax.annotation.Nullable
          io.opencensus.metrics.export.Distribution.BucketOptions bucketOptions) {
    final BucketOptions.Builder builder = BucketOptions.newBuilder();
    if (bucketOptions == null) {
      return builder.build();
    }

    return bucketOptions.match(
        bucketOptionsExplicitFunction, Functions.<BucketOptions>throwIllegalArgumentException());
  }
1301250
static Options getProgramSpecificOptions(Options options) {
		options.addOption(JAR_OPTION);
		options.addOption(CLASS_OPTION);
		options.addOption(PARALLELISM_OPTION);
		options.addOption(ARGS_OPTION);
		return options;
	}
621623
public static ClientOptions of(ClientOptions baseOptions, Iterable<ClientOptionValue<?>> options) {
        // TODO(trustin): Reduce the cost of creating a derived ClientOptions.
        requireNonNull(baseOptions, "baseOptions");
        requireNonNull(options, "options");
        return new ClientOptions(baseOptions, options);
    }
245948
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public CallOptions withOption() {
    CallOptions opts = CallOptions.DEFAULT;
    for (int i = 0; i < customOptions.size(); i++) {
      opts = opts.withOption(customOptions.get(i), "value");
    }
    return opts;
  }
1230873
@SuppressWarnings("static-access")
  public static Options buildOptions() {
    Options options = new Options();

    // actual commands
    options.addOption(OptionBuilder.hasOptionalArgs().create(waitTxIdCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(failoverCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(
        prepfailoverCommand));

    options.addOption(OptionBuilder.hasOptionalArgs().create(metasaveCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(safemodeCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(
        saveNamespaceCommand));

    options.addOption(OptionBuilder.hasOptionalArgs().create(setAvatarCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(
        isInitializedCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(
        shutdownAvatarCommand));
    options
        .addOption(OptionBuilder.hasOptionalArgs().create(showAvatarCommand));

    // helper commands
    options.addOption(OptionBuilder.hasOptionalArgs().create(zeroCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(oneCommand));

    options.addOption(OptionBuilder.hasOptionalArgs().create(serviceCommand));
    options.addOption(OptionBuilder.hasOptionalArgs().create(addressCommand));

    return options;
  }
1159579
public ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions) {
    Validator.notNull(identifyOptions, "identifyOptions cannot be null");
    String[] pathSegments = { "v3/identify" };
    RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("language_translator", "v3", "identify");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    builder.bodyContent(identifyOptions.text(), "text/plain");
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IdentifiedLanguages.class));
  }
1345902
public ElementWithOptions setOptions(LinkedHashMap<String, String> options) {
        this.optionGroups.clear();
        for (Map.Entry<String, String> entry : options.entrySet()) {
            this.addOption(entry.getKey(), entry.getValue());
        }

        return this;
    }
574471
static Options getInfoOptions(Options options) {
		options = getProgramSpecificOptions(options);
		options = getJobManagerAddressOption(options);
		options.addOption(DESCR_OPTION);
		options.addOption(PLAN_OPTION);
		return options;
	}