Returns an {@code Option} instance containing the given non-null reference.
323181
public static <T> Option<T> some(T reference) {
    return new Some<T>(Assert.notNull(reference));
  }
1351568
private OptionHandler findOptionByName(String name) {
		for (OptionHandler h : options) {
			NamedOptionDef option = (NamedOptionDef)h.option;
			if (name.equals(option.name())) {
				return h;
			}
			for (String alias : option.aliases()) {
				if (name.equals(alias)) {
					return h;
				}
			}
		}
		return null;
	}
805468
@SuppressWarnings("unchecked")
    protected final <O extends AbstractOption<V>, V> Optional<V> get0(AbstractOption<V> option) {
        @SuppressWarnings("rawtypes")
        final AbstractOptionValue<O, V> optionValue =
                (AbstractOptionValue<O, V>) valueMap.get(option);
        return optionValue == null ? Optional.empty() : Optional.of(optionValue.value());
    }
670435
public @NotNull OptionalDouble findOptionalDouble(@NotNull @SQL String sql, Object... args) {
        return findOptionalDouble(SqlQuery.query(sql, args));
    }
477324
public static Option findListOption(Option[] options) {
        for (int i = 0; i < options.length; i++) {
            if (options[i].getType() == Type.LIST) {
                return options[i];
            }
        }
        return null;
    }
732764
@Pure
	@SuppressWarnings("static-method")
	public Object getFirstOptionValue(String optionLabel) {
		final List<Object> options = getCommandLineOption(optionLabel);
		if (options == null || options.isEmpty()) {
			return null;
		}
		return options.get(0);
	}
1036260
public <T> Option<T> findOption(Option<T> option) {
        for (Option candidateOption : options) {
            if (candidateOption.hasSameNameAs(option)) {
                return candidateOption;
            }
        }
        throw new RuntimeException("You tried to set an unexpected option");
    }
402441
public Object getOneOptional(String name) {
		Object locator = find(name);
		return locator != null ? _references.getOneOptional(locator) : null;
	}
955025
public static <T, R> Optional<R> getOptionalIfExist(Optional<T> optional,
            Function<T, R> returnBuilderFunction) {
        return optional.map(returnBuilderFunction);
    }
951699
public @NotNull <T> Optional<T> findOptional(@NotNull RowMapper<T> rowMapper, @NotNull @SQL String sql, Object... args) {
        return findOptional(rowMapper, SqlQuery.query(sql, args));
    }
664532
public static <T> T checkNotNull(T reference) {
    return com.google.common.base.Preconditions.checkNotNull(reference);
  }
1033172
public static CreateOptions getOpt(Class<? extends CreateOptions> theClass, CreateOptions... opts) {
    if (opts == null)
      return null;
    CreateOptions result = null;
    for (int i = 0; i < opts.length; ++i) {
      if (opts[i].getClass() == theClass) {
        if (result != null)
          throw new IllegalArgumentException("Multiple args with type " + theClass);
        result = opts[i];
      }
    }
    return result;
  }
788402
@SuppressWarnings("unchecked")
    public <V> V getOption(java.lang.String key)
    {
        return (V)extraOptions.get(key);
    }
5043
public F0<Option<R>> lift() {
            final F0<R> me = this;
            return new F0<Option<R>>() {
                @Override
                public Option<R> apply() {
                    try {
                        return some(me.apply());
                    } catch (RuntimeException e) {
                        return none();
                    }
                }
            };
        }
270746
public static <T> OptionType<T> of(
    final @Nullable T x)
  {
    if (x == null) {
      return None.none();
    }

    return Some.some(x);
  }
338625
public static <E> OptionalFunction<Selection<Element>, E> getValue() {
    return OptionalFunction.of(selection -> selection.result().getValue());
  }
481743
public List<Object> getOptional(String name) {
		Object locator = find(name);
		return locator != null ? _references.getOptional(locator) : null;
	}