Visitor.SafeGenerics (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.helpers.collection

## Class Visitor.SafeGenerics

- java.lang.Object
- - org.neo4j.helpers.collection.Visitor.SafeGenerics

- Enclosing interface:
    Visitor<E,FAILURE extends Exception>

      public static final class Visitor.SafeGenerics
      extends Object

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T,F extends Exception> Visitor<? super T,? extends F>` | `castOrNull(Class<T> eType, Class<F> fType, Object visitor)` Useful for determining "is this an object that can visit the things I can provide?" Checks if the passed in object is a `Visitor` and if the objects it can `visit` is compatible (super type of) with the provided type.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### castOrNull

          public static <T,F extends Exception> Visitor<? super T,? extends F> castOrNull(Class<T> eType,
                                                                          Class<F> fType,
                                                                          Object visitor)

      Useful for determining "is this an object that can visit the things I can provide?" Checks if the passed in object is a `Visitor` and if the objects it can `visit` is compatible (super type of) with the provided type. Returns the visitor cast to compatible type parameters. If the passed in object is not an instance of `Visitor`, or if it is a `Visitor` but one that `visits` another type of object, this method returns `null`.

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.