Example usage for com.google.common.base Optional absent

List of usage examples for com.google.common.base Optional absent

Introduction

In this page you can find the example usage for com.google.common.base Optional absent.

Prototype

public static <T> Optional<T> absent() 

Source Link

Document

Returns an Optional instance with no contained reference.

Usage

From source file:org.locationtech.geogig.plumbing.diff.DiffPathTracker.java

private Optional<ObjectId> metadataId(@Nullable Node treeNode) {
    if (treeNode == null) {
        return Optional.absent();
    }/*from ww  w .  ja va  2 s  .c  om*/
    return treeNode.getMetadataId();
}

From source file:org.apache.druid.tasklogs.TaskLogStreamer.java

default Optional<ByteSource> streamTaskReports(final String taskid) throws IOException {
    return Optional.absent();
}

From source file:org.onos.yangtools.yang.data.impl.schema.tree.RecursiveWriteCandidateNode.java

@Override
public Optional<NormalizedNode<?, ?>> getDataBefore() {
    return Optional.absent();
}

From source file:com.github.hamishmorgan.xomb.impl.DocTypeBuilderImpl.java

DocTypeBuilderImpl(@Nonnull NodeFactory factory) {
    super(factory);
    rootElementName = Optional.absent();
    systemID = Optional.absent();
    publicID = Optional.absent();
    internalDTDSubset = Optional.absent();
}

From source file:software.betamax.TapeMode.java

public Optional<TapeMode> toOptional() {
    if (this.equals(TapeMode.UNDEFINED)) {
        return Optional.absent();
    } else {//from www  .ja va 2 s .co  m
        return Optional.of(this);
    }
}

From source file:org.eclipse.emf.compare.ide.ui.internal.logical.resolver.ResourceDependencyFoundEvent.java

/**
 * Returns the URI of the {@code parent} object causing this dependency, if it is the actual owner of the
 * dependency.//from  www  . j  a  va 2s  .c o m
 * <p>
 * The {@code parent} object is the actual owner if the {@code feature} through which the {@code parent}
 * object refers to the dependency is a {@link EReference#isContainment() containment reference}.
 * </p>
 * 
 * @param parent
 *            The object in the source causing the dependency
 * @param feature
 *            The feature through which the parent causes the dependency
 * @return the URI of the parent if it is the owner of the dependency, otherwise {@link Optional#absent()}
 */
private static Optional<URI> getParentUriIfContainmentReference(EObject parent, EStructuralFeature feature) {
    if (feature instanceof EReference && ((EReference) feature).isContainment()) {
        return Optional.of(getUri(parent));
    }
    return Optional.absent();
}

From source file:org.zanata.email.EmailStrategy.java

public Optional<InternetAddress[]> getReplyToAddress() {
    return Optional.absent();
}

From source file:com.facebook.buck.cli.JavaUtilLogHandlers.java

public static Optional<ConsoleHandler> getConsoleHandler() {
    // We can't stop someone from mutating this array, but we can minimize the chance.
    ImmutableList<Handler> handlers = ImmutableList.copyOf(Logger.getLogger("").getHandlers());
    for (Handler handler : handlers) {
        if (handler instanceof ConsoleHandler) {
            return Optional.of((ConsoleHandler) handler);
        } else if (handler instanceof Callable<?>) {
            // com.facebook.buck.cli.bootstrapper.ConsoleHandler is not
            // visible to us, so thunk it through Callable<Handler> so
            // we can get at the real ConsoleHandler.
            Callable<?> callable = (Callable<?>) handler;
            try {
                Object innerHandler = callable.call();
                if (innerHandler instanceof ConsoleHandler) {
                    return Optional.of((ConsoleHandler) innerHandler);
                }/*from   w  w w . j a  v a2  s  .  com*/
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }

    // If we hit this, something has gone wrong and we can't find the
    // ConsoleHandler from the list of registered log handlers.
    //
    // This means SuperConsole will not be notified when we print log
    // messages to console, so it will not disable itself, causing log
    // console logs to collide with SuperConsole output.
    System.err.println("WARNING: Cannot find ConsoleHandler log handler. "
            + "Logs printed to console will likely be lost.");
    return Optional.absent();
}

From source file:org.sosy_lab.cpachecker.cpa.wp.WpAbstractState.java

public Optional<PathFormula> getHealthyPathFormula() {
    if (healthyPathFormula == null) {
        return Optional.absent();
    }//from   w ww  .java2 s. com
    return Optional.of(healthyPathFormula);
}

From source file:com.afterkraft.kraftrpg.api.util.Utilities.java

@SuppressWarnings("unchecked")
public static Optional<ItemStack> loadItem(Object root) {
    return Optional.absent();
}