Class Finder.ByNameFinder

java.lang.Object
com.nomagic.magicdraw.uml.Finder.ByNameFinder
Enclosing class:
Finder

public static final class Finder.ByNameFinder extends Object
Search for any first element by simple name among the given root element(s) and direct children of root element(s)
  • Method Details

    • find

      @CheckForNull public <T extends Element> T find(Element root, @CheckForNull Class type, String name)
      Find element by name. Include root(s) into a search.
      Parameters:
      root - root element
      type - strict class type of element. Nulls means any element
      name - Element name
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Element root, @CheckForNull Class[] type, String name)
      Find element by name. Include root(s) into a search.
      Parameters:
      root - root element
      type - strict class types of element. Nulls means any element
      name - Element name
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Element root, @CheckForNull Class type, String name, boolean includeRoot)
      Find element by name.
      Parameters:
      root - root element
      type - strict class type of element. Nulls means any element
      name - Element name
      includeRoot - include root element into a search
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Element root, @CheckForNull Class[] type, String name, boolean includeRoot)
      Find element by name.
      Parameters:
      root - root element
      type - strict class types of element. Nulls means any element
      name - Element name
      includeRoot - include root element into a search
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Collection<? extends Element> roots, @CheckForNull Class[] type, String name)
      Find element by name. Include root(s) into a search.
      Parameters:
      roots - root elements
      type - strict class types of element. Nulls means any element
      name - Element name
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Collection<? extends Element> roots, @CheckForNull Class type, String name)
      Find element by name. Include root(s) into a search.
      Parameters:
      roots - root elements
      type - strict class type of element. Nulls means any element
      name - Element name
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Collection<? extends Element> roots, @CheckForNull Class type, String name, boolean includeRoot)
      Find element by name.
      Parameters:
      roots - root element
      type - strict class type of element. Nulls means any element
      name - Element name
      includeRoot - include root element into a search
      Returns:
      found Element or null
    • find

      @CheckForNull public <T extends Element> T find(Collection<? extends Element> roots, @CheckForNull Class[] type, String name, boolean includeRoot)
      Find element by name.
      Parameters:
      roots - root element
      type - strict class types of element. Nulls means any element
      name - Element name
      includeRoot - include root element into a search
      Returns:
      found Element or null
    • findInCollection

      public <T extends Element> Collection<T> findInCollection(Collection<T> elements, String name)
      Find NameElements in a given collection with a given name
      Parameters:
      elements - elements
      name - element name
      Returns:
      found Elements
    • findFirstInCollection

      @CheckForNull public <T extends Element> T findFirstInCollection(Collection<T> elements, String name)
      Find first NameElement in a given collection with a given name
      Parameters:
      elements - elements
      name - element name
      Returns:
      found Element