Package com.google.gwt.core.ext.linker

## Class Artifact<C extends Artifact<C>>

- java.lang.Object
- - com.google.gwt.core.ext.linker.Artifact<C>

- Type Parameters:
    `C` - The type of Artifact interface that the Artifact can be compared to.
  All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Comparable<Artifact<?>>`
  Direct Known Subclasses:
    `CompilationMetricsArtifact`, `CompilationResult`, `EmittedArtifact`, `ModuleMetricsArtifact`, `PrecompilationMetricsArtifact`, `RpcLogArtifact`, `RpcPolicyFileArtifact`, `ScriptReference`, `StylesheetReference`, `SymbolMapsLinker.ScriptFragmentEditsArtifact`

      public abstract class Artifact<C extends Artifact<C>>
      extends java.lang.Object
      implements java.lang.Comparable<Artifact<?>>, java.io.Serializable

  A base type for all artifacts relating to the link process. In order to ensure stable output between runs of the compiler, Artifact types must implement a stable comparison between instances of a relevant base type (the exact comparison order is irrelevant).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Artifact​(java.lang.Class<? extends Linker> linker)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `compareTo​(Artifact<?> o)` |
    `protected abstract int` | `compareToComparableArtifact​(C o)` | Performs comparison with an artifact of a compatible base type.
    `boolean` | `equals​(java.lang.Object obj)` | Delegates to `compareTo(Artifact)`.
    `protected abstract java.lang.Class<C>` | `getComparableArtifactType()` | Returns the base type to use for comparisons between Artifacts.
    `java.lang.Class<? extends Linker>` | `getLinker()` | Returns the Linker that created the Artifact.
    `abstract int` | `hashCode()` | The class which is returned from `getComparableArtifactType()` must declare a final implementation which returns the same hash code for objects for which `compareToComparableArtifact(Artifact)` returns 0.
    `boolean` | `isTransferableFromShards()` | Returns whether the `Transferable` annotation is present on this class.
    `java.lang.String` | `toString()` |

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Artifact

          protected Artifact​(java.lang.Class<? extends Linker> linker)

      Constructor.
      Parameters:
        `linker` - the type of Linker that instantiated the Artifact.

  - ### Method Detail

    - #### compareTo

          public final int compareTo​(Artifact<?> o)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<C extends Artifact<C>>`

    - #### equals

          public final boolean equals​(java.lang.Object obj)

      Delegates to `compareTo(Artifact)`.
      Overrides:
        `equals` in class `java.lang.Object`

    - #### getLinker

          public final java.lang.Class<? extends Linker> getLinker()

      Returns the Linker that created the Artifact.

    - #### hashCode

          public abstract int hashCode()

      The class which is returned from `getComparableArtifactType()` must declare a final implementation which returns the same hash code for objects for which `compareToComparableArtifact(Artifact)` returns 0.
      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### isTransferableFromShards

          public final boolean isTransferableFromShards()

      Returns whether the `Transferable` annotation is present on this class. See `Transferable` for the implications.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### compareToComparableArtifact

          protected abstract int compareToComparableArtifact​(C o)

      Performs comparison with an artifact of a compatible base type. Objects which compare to 0 are assumed equal, and must return the same `hashCode()`.

    - #### getComparableArtifactType

          protected abstract java.lang.Class<C> getComparableArtifactType()

      Returns the base type to use for comparisons between Artifacts. All concrete implementations of this methods must be final.