SearchByAUIDImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.union.impl

## Class SearchByAUIDImpl

- java.lang.Object
- - tv.amwa.maj.union.impl.SearchCriteriaImpl
  - - tv.amwa.maj.union.impl.SearchByAUIDImpl

- All Implemented Interfaces:
    Serializable, Cloneable, SearchByAUID, SearchCriteria

      public class SearchByAUIDImpl
      extends SearchCriteriaImpl
      implements SearchByAUID, Serializable, Cloneable

  Implementation of a search criteria for matching packages defined by an AUID value. The kind of search represented by this criteria must be set using method `setTag(SearchTag)` or through the constructor.

  See Also:
    `ContentStorage.getPackages(tv.amwa.maj.union.SearchCriteria)`, `Preface.getPackages(tv.amwa.maj.union.SearchCriteria)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchByAUIDImpl(SearchTag tag, AUID identification)` Create a search criteria defined by an AUID and the kind of item that the item identifies.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SearchByAUIDImpl` | `clone()`
    `boolean` | `equals(Object o)`
    `AUID` | `getAUID()` Returns the AUID that defines this search criteria.
    `int` | `hashCode()`
    `void` | `setAUID(AUID identification)` Sets the AUID that defines this search criteria.
    `void` | `setTag(SearchTag tag)` Set the search type of this search criteria that matches items using an AUID.
    `String` | `toString()` Create a pseudo-XML representation of this search by AUID criteria.

    - ### Methods inherited from class tv.amwa.maj.union.impl.SearchCriteriaImpl

      `getSearchTag`

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

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.union.SearchCriteria

      `getSearchTag`

- - ### Constructor Detail

    - #### SearchByAUIDImpl

          public SearchByAUIDImpl(SearchTag tag,
                                  AUID identification)
                           throws NullPointerException,
                                  IllegalArgumentException

      Create a search criteria defined by an AUID and the kind of item that the item identifies.

      Parameters:
        `tag` - Kind of item that the AUID identifies, indicating the kind of match performed by a search using this criteria.
        `identification` - Identifier defining this search criteria.
      Throws:
        `NullPointerException` - One or both of the given tag or identification values is `null`.
        `IllegalArgumentException`

  - ### Method Detail

    - #### getAUID

          public AUID getAUID()

      Description copied from interface: `SearchByAUID`

      Returns the AUID that defines this search criteria.

      Specified by:
        `getAUID` in interface `SearchByAUID`
      Returns:
        AUID of this search criteria.

    - #### setAUID

          public void setAUID(AUID identification)
                       throws NullPointerException

      Description copied from interface: `SearchByAUID`

      Sets the AUID that defines this search criteria.

      Specified by:
        `setAUID` in interface `SearchByAUID`
      Parameters:
        `identification` - AUID of this search criteria.
      Throws:
        `NullPointerException` - The given identification is `null`.

    - #### setTag

          public void setTag(SearchTag tag)
                      throws NullPointerException,
                             IllegalArgumentException

      Description copied from interface: `SearchByAUID`

      Set the search type of this search criteria that matches items using an AUID. The tag must be compatible with matching using AUID values. If this search is not compatible, an `IllegalArgumentException` is thrown. Acceptable tags are:

      - `SearchTag.ByClass`
      - `SearchTag.ByDataDef`
      - `SearchTag.ByUsageCode`
      - `SearchTag.ByCompositionPackageUsageCode`
      - `SearchTag.ByMaterialPackageUsageCode`
      - `SearchTag.BySourcePackageUsageCode`
      Specified by:
        `setTag` in interface `SearchByAUID`
      Parameters:
        `tag` - Tag that identifies the kind of this search by AUID criteria.
      Throws:
        `NullPointerException` - The given search tag is `null`.
        `IllegalArgumentException` - The search tag is not compatible with criteria matching using AUID values.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Create a pseudo-XML representation of this search by AUID criteria. No XML schema or DTD defines this element. For example:

           <SearchByDataDef identification="urn:x-ul:060e2b34.0401.0101.01030202.01000000"/>

      Overrides:
        `toString` in class `Object`
      Returns:
        XML representation of this search by AUID criteria.

    - #### clone

          public SearchByAUIDImpl clone()
                                 throws CloneNotSupportedException

      Overrides:
        `clone` in class `Object`
      Throws:
        `CloneNotSupportedException`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.