Optional
@return
546280
@Override
    public Map<String, Object> getTuningConfig() {
        return ImmutableMap.<String, Object>of(
                "type", "hadoop",
                "partitionsSpec", partitionsSpec.getDataMap());
    }
101454
public Optional<T> first() {
    Iterator<T> itr = iterator();
    return itr.hasNext() ? Optional.of(itr.next()) : Optional.<T>absent();
  }
647931
public Optional<ServerPort> activePort() {
        synchronized (activePorts) {
            return Optional.ofNullable(Iterables.getFirst(activePorts.values(), null));
        }
    }
609437
@javax.annotation.Nonnull
    public java.util.Optional<net.morimekta.util.Binary> optionalData() {
        return java.util.Optional.ofNullable(mData);
    }
634576
public final Parser<T> optional(T defaultValue) {
    return Parsers.or(this, Parsers.constant(defaultValue));
  }
1351843
public @Nonnull Optional<XQuery> parent() {
        synchronized (this) {
            if (parent.get() == null) {
                parent.set(Optional.ofNullable(node.getParentNode()).map(XQuery::new));
            }
        }
        return parent.get();
    }
264209
public static <K, V, M extends Map<K, V>> Optional<M> getOptional(M map) {
        return Optional.ofNullable(map).filter(m -> m.size() > 0);
    }
494723
def is_optional(self):
        
        if (('optional' in self.attributes and bool(self.attributes['optional'].strip())) and
                ('minValue' in self.attributes and self.attributes['minValue'] == 0)):
            return True
        else:
            return False
891127
public @NonNull Optional<T> get(final @NonNull String name) {
    return Optional.ofNullable(this.byName.get(name));
  }
613491
public static <T, S extends T> Optional<T> of(S value) {
    if (value == null) {
      throw new IllegalArgumentException("Optional does not support NULL, use Optional.empty() instead.");
    }

    return new Optional<T>(value);
  }
338625
public static <E> OptionalFunction<Selection<Element>, E> getValue() {
    return OptionalFunction.of(selection -> selection.result().getValue());
  }
1137767
public Optional<ServerPort> activePort() {
        final Server server = this.server;
        return server != null ? server.activePort() : Optional.empty();
    }
857311
public Optional<String> getCurrent() {
        final LinkedList<String> uuids = context.get();
        return uuids.isEmpty()
                ? Optional.empty()
                : Optional.of(uuids.getFirst());
    }
643975
public static <T> Optional<T[]> getOptional(T[] array) {
        return Optional.ofNullable(array).filter(a -> a.length > 0);
    }
388355
@SuppressWarnings("unchecked")
    public static <T> Optional<HttpRequest<T>> currentRequest() {
        return Optional.ofNullable(REQUEST.get());
    }
231427
@javax.annotation.Nonnull
    public java.util.Optional<net.morimekta.providence.model.FilePos> optionalValueStartPos() {
        return java.util.Optional.ofNullable(mValueStartPos);
    }
544769
public static <E> Optional<E> find(final Iterable<E> iterable, final Predicate<E> pred) {
        for (E element : iterable) {
            if (pred.test(element)) {
                return Optional.of(element);
            }
        }
        return Optional.absent();
    }