blob: 338d851072f305375ac466f0034c0bdbe65f381f [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>
Key
| Guice
</title>
<link href="../../../../javadoc/assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../javadoc/assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="../../../../javadoc/assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../../javadoc/assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../../javadoc/assets/android-developer-docs.js" type="text/javascript"></script>
<script src="../../../../javadoc/assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
setToRoot("../../../", "../../../../javadoc/assets/");
</script>
<script src="../../../../javadoc/assets/android-developer-reference.js" type="text/javascript"></script>
<script src="../../../../javadoc/assets/navtree_data.js" type="text/javascript"></script>
<script src="../../../../javadoc/assets/customizations.js" type="text/javascript"></script>
<noscript>
<style type="text/css">
html,body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
</head>
<body class="Guice_1.0">
<div id="header">
<div id="headerLeft">
<span id="masthead-title">Guice</span>
</div>
<div id="headerRight">
<div id="search" >
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box"
onsubmit="return submit_search()">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
title="search developer docs" name="q"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../')"
onkeyup="return search_changed(event, false, '../../../')" />
<div id="search_filtered_div" class="no-display">
<table id="search_filtered" cellspacing=0>
</table>
</div>
</td>
<td class="gsc-search-button">
<input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button">&nbsp;</div>
</td>
</tr></tbody>
</table>
</form>
</div><!-- searchForm -->
</div><!-- search -->
<div id="api-level-toggle">
<input type="checkbox" id="apiLevelCheckbox" onclick="toggleApiLevelSelector(this)" />
<label for="apiLevelCheckbox" class="disabled">Filter by API Level: </label>
<select id="apiLevelSelector">
<!-- option elements added by buildApiLevelSelector() -->
</select>
</div>
<script>
var SINCE_DATA = [ 'Guice_1.0', 'Guice_2.0', 'Guice_3.0' ];
var SINCE_LABELS = [ 'Guice_1.0', 'Guice_2.0', 'Guice_3.0' ];
buildApiLevelSelector();
addLoadEvent(changeApiLevel);
</script>
</div>
</div><!-- header -->
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav">
<div id="index-links"><nobr>
<a href="../../../packages.html" >Package Index</a> |
<a href="../../../classes.html" >Class Index</a></nobr>
</div>
<ul>
<li class="selected api apilevel-Guice_1.0">
<a href="../../../com/google/inject/package-summary.html">com.google.inject</a></li>
<li class="api apilevel-Guice_2.0">
<a href="../../../com/google/inject/assistedinject/package-summary.html">com.google.inject.assistedinject</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/binder/package-summary.html">com.google.inject.binder</a></li>
<li class="api apilevel-Guice_3.0">
<a href="../../../com/google/inject/grapher/package-summary.html">com.google.inject.grapher</a></li>
<li class="api apilevel-Guice_3.0">
<a href="../../../com/google/inject/grapher/graphviz/package-summary.html">com.google.inject.grapher.graphviz</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/jndi/package-summary.html">com.google.inject.jndi</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/matcher/package-summary.html">com.google.inject.matcher</a></li>
<li class="api apilevel-Guice_2.0">
<a href="../../../com/google/inject/multibindings/package-summary.html">com.google.inject.multibindings</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/name/package-summary.html">com.google.inject.name</a></li>
<li class="api apilevel-Guice_3.0">
<a href="../../../com/google/inject/persist/package-summary.html">com.google.inject.persist</a></li>
<li class="api apilevel-Guice_3.0">
<a href="../../../com/google/inject/persist/finder/package-summary.html">com.google.inject.persist.finder</a></li>
<li class="api apilevel-Guice_3.0">
<a href="../../../com/google/inject/persist/jpa/package-summary.html">com.google.inject.persist.jpa</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/servlet/package-summary.html">com.google.inject.servlet</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/spi/package-summary.html">com.google.inject.spi</a></li>
<li class="api apilevel-Guice_2.0">
<a href="../../../com/google/inject/spring/package-summary.html">com.google.inject.spring</a></li>
<li class="api apilevel-Guice_2.0">
<a href="../../../com/google/inject/throwingproviders/package-summary.html">com.google.inject.throwingproviders</a></li>
<li class="api apilevel-Guice_1.0">
<a href="../../../com/google/inject/tools/jmx/package-summary.html">com.google.inject.tools.jmx</a></li>
<li class="api apilevel-Guice_2.0">
<a href="../../../com/google/inject/util/package-summary.html">com.google.inject.util</a></li>
</ul><br/>
</div> <!-- end packages -->
</div> <!-- end resize-packages -->
<div id="classes-nav">
<ul>
<li><h2>Interfaces</h2>
<ul>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Binder.html">Binder</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Binding.html">Binding</a>&lt;T&gt;</li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Injector.html">Injector</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/MembersInjector.html">MembersInjector</a>&lt;T&gt;</li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Module.html">Module</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/PrivateBinder.html">PrivateBinder</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Provider.html">Provider</a>&lt;T&gt;</li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Scope.html">Scope</a></li>
</ul>
</li>
<li><h2>Classes</h2>
<ul>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/AbstractModule.html">AbstractModule</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Guice.html">Guice</a></li>
<li class="selected api apilevel-Guice_1.0"><a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/PrivateModule.html">PrivateModule</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Scopes.html">Scopes</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt;</li>
</ul>
</li>
<li><h2>Annotations</h2>
<ul>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/BindingAnnotation.html">BindingAnnotation</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/Exposed.html">Exposed</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ImplementedBy.html">ImplementedBy</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Inject.html">Inject</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ProvidedBy.html">ProvidedBy</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/Provides.html">Provides</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/ScopeAnnotation.html">ScopeAnnotation</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Singleton.html">Singleton</a></li>
</ul>
</li>
<li><h2>Enums</h2>
<ul>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/Stage.html">Stage</a></li>
</ul>
</li>
<li><h2>Exceptions</h2>
<ul>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/ConfigurationException.html">ConfigurationException</a></li>
<li class="api apilevel-Guice_1.0"><a href="../../../com/google/inject/CreationException.html">CreationException</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/OutOfScopeException.html">OutOfScopeException</a></li>
<li class="api apilevel-Guice_2.0"><a href="../../../com/google/inject/ProvisionException.html">ProvisionException</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none">
<div id="index-links"><nobr>
<a href="../../../packages.html" >Package Index</a> |
<a href="../../../classes.html" >Class Index</a></nobr>
</div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
</div> <!-- end side-nav -->
<script>
if (!isMobile) {
$("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../");
} else {
addLoadEvent(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
}
$("#swapper").css({borderBottom:"2px solid #aaa"});
} else {
swapNav(); // tree view should be used on mobile
}
</script>
<div class="g-unit" id="doc-content">
<div id="api-info-block">
<div class="sum-details-links">
Summary:
<a href="#proctors">Protected Ctors</a>
&#124; <a href="#pubmethods">Methods</a>
&#124; <a href="#inhmethods">Inherited Methods</a>
&#124; <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
</div><!-- end sum-details-links -->
<div class="api-level">
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div><!-- end api-info-block -->
<!-- ======== START OF CLASS DATA ======== -->
<div id="jd-header">
public
class
<h1>Key</h1>
extends Object<br/>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-Guice_1.0">
<table class="jd-inheritance-table">
<tr>
<td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td>
</tr>
<tr>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;&#x21b3;</td>
<td colspan="1" class="jd-inheritance-class-cell">com.google.inject.Key&lt;T&gt;</td>
</tr>
</table>
<div class="jd-descr">
<h2>Class Overview</h2>
<p>Binding key consisting of an injection type and an optional annotation.
Matches the type and annotation at a point of injection.
<p>For example, <code>Key.get(Service.class, Transactional.class)</code> will
match:
<pre>
@Inject
public void setService(@Transactional Service service) {
...
}
</pre>
<p><code>Key</code> supports generic types via subclassing just like <code><a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a></code>.
<p>Keys do not differentiate between primitive types (int, char, etc.) and
their correpsonding wrapper types (Integer, Character, etc.). Primitive
types will be replaced with their wrapper types when keys are created.</p>
</div><!-- jd-descr -->
<div class="jd-descr">
<h2>Summary</h2>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<table id="proctors" class="jd-sumtable"><tr><th colspan="12">Protected Constructors</th></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#Key()">Key</a></span>()</nobr>
<div class="jd-descrdiv">Constructs a new key.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#Key(java.lang.Class<? extends java.lang.annotation.Annotation>)">Key</a></span>(Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</nobr>
<div class="jd-descrdiv">Constructs a new key.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#Key(java.lang.annotation.Annotation)">Key</a></span>(Annotation annotation)</nobr>
<div class="jd-descrdiv">Constructs a new key.</div>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
<tr class="alt-color api apilevel-Guice_2.0" >
<td class="jd-typecol"><nobr>
final
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#equals(java.lang.Object)">equals</a></span>(Object o)</nobr>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(com.google.inject.TypeLiteral<T>)">get</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(com.google.inject.TypeLiteral<T>, java.lang.Class<? extends java.lang.annotation.Annotation>)">get</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation type.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(com.google.inject.TypeLiteral<T>, java.lang.annotation.Annotation)">get</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral, Annotation annotation)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.Class<T>)">get</a></span>(Class&lt;T&gt; type)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.Class<T>, java.lang.Class<? extends java.lang.annotation.Annotation>)">get</a></span>(Class&lt;T&gt; type, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation type.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.Class<T>, java.lang.annotation.Annotation)">get</a></span>(Class&lt;T&gt; type, Annotation annotation)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.reflect.Type)">get</a></span>(Type type)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.reflect.Type, java.lang.Class<? extends java.lang.annotation.Annotation>)">get</a></span>(Type type, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation type.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#get(java.lang.reflect.Type, java.lang.annotation.Annotation)">get</a></span>(Type type, Annotation annotation)</nobr>
<div class="jd-descrdiv">Gets a key for an injection type and an annotation.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
final
Annotation</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#getAnnotation()">getAnnotation</a></span>()</nobr>
<div class="jd-descrdiv">Gets the annotation.</div>
</td></tr>
<tr class=" api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
final
Class&lt;?&nbsp;extends&nbsp;Annotation&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#getAnnotationType()">getAnnotationType</a></span>()</nobr>
<div class="jd-descrdiv">Gets the annotation type.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_1.0" >
<td class="jd-typecol"><nobr>
final
<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#getTypeLiteral()">getTypeLiteral</a></span>()</nobr>
<div class="jd-descrdiv">Gets the key type.</div>
</td></tr>
<tr class=" api apilevel-Guice_3.0" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#hasAttributes()">hasAttributes</a></span>()</nobr>
<div class="jd-descrdiv">Returns true if this key has annotation attributes.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_2.0" >
<td class="jd-typecol"><nobr>
final
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#hashCode()">hashCode</a></span>()</nobr>
</td></tr>
<tr class=" api apilevel-Guice_3.0" >
<td class="jd-typecol"><nobr>
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#ofType(com.google.inject.TypeLiteral<T>)">ofType</a></span>(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; type)</nobr>
<div class="jd-descrdiv">Returns a new key of the specified type with the same annotation as this
key.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_3.0" >
<td class="jd-typecol"><nobr>
&lt;T&gt;
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#ofType(java.lang.Class<T>)">ofType</a></span>(Class&lt;T&gt; type)</nobr>
<div class="jd-descrdiv">Returns a new key of the specified type with the same annotation as this
key.</div>
</td></tr>
<tr class=" api apilevel-Guice_3.0" >
<td class="jd-typecol"><nobr>
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#ofType(java.lang.reflect.Type)">ofType</a></span>(Type type)</nobr>
<div class="jd-descrdiv">Returns a new key of the specified type with the same annotation as this
key.</div>
</td></tr>
<tr class="alt-color api apilevel-Guice_2.0" >
<td class="jd-typecol"><nobr>
final
String</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#toString()">toString</a></span>()</nobr>
</td></tr>
<tr class=" api apilevel-Guice_3.0" >
<td class="jd-typecol"><nobr>
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../com/google/inject/Key.html#withoutAttributes()">withoutAttributes</a></span>()</nobr>
<div class="jd-descrdiv">Returns this key without annotation attributes, i.e.</div>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="inhmethods" class="jd-sumtable"><tr><th>
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
<div style="clear:left;">Inherited Methods</div></th></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Object-trigger"
src="../../../../javadoc/assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From class
java.lang.Object
<div id="inherited-methods-java.lang.Object">
<div id="inherited-methods-java.lang.Object-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Object-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
Object</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">clone</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">equals</span>(Object arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">finalize</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
Class&lt;?&gt;</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getClass</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">hashCode</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">notify</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">notifyAll</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
String</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">toString</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>(long arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>(long arg0, int arg1)</nobr>
</td></tr>
</table>
</div>
</div>
</td></tr>
</table>
</div><!-- jd-descr (summary) -->
<!-- Details -->
<!-- XML Attributes -->
<!-- Enum Values -->
<!-- Constants -->
<!-- Fields -->
<!-- Public ctors -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->
<h2>Protected Constructors</h2>
<A NAME="Key()"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
protected
</span>
<span class="sympad">Key</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constructs a new key. Derives the type from this class's type parameter.
<p>Clients create an empty anonymous subclass. Doing so embeds the type
parameter in the anonymous class's type hierarchy so we can reconstitute it
at runtime despite erasure.
<p>Example usage for a binding of type <code>Foo</code>:
<p><code>new Key&lt;Foo&gt;() {</code>}.
</p></div>
</div>
</div>
<A NAME="Key(java.lang.Class<? extends java.lang.annotation.Annotation>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
protected
</span>
<span class="sympad">Key</span>
<span class="normal">(Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constructs a new key. Derives the type from this class's type parameter.
<p>Clients create an empty anonymous subclass. Doing so embeds the type
parameter in the anonymous class's type hierarchy so we can reconstitute it
at runtime despite erasure.
<p>Example usage for a binding of type <code>Foo</code> annotated with
<code>@Bar</code>:
<p><code>new Key&lt;Foo&gt;(Bar.class) {</code>}.
</p></div>
</div>
</div>
<A NAME="Key(java.lang.annotation.Annotation)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
protected
</span>
<span class="sympad">Key</span>
<span class="normal">(Annotation annotation)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Constructs a new key. Derives the type from this class's type parameter.
<p>Clients create an empty anonymous subclass. Doing so embeds the type
parameter in the anonymous class's type hierarchy so we can reconstitute it
at runtime despite erasure.
<p>Example usage for a binding of type <code>Foo</code> annotated with
<code>@Bar</code>:
<p><code>new Key&lt;Foo&gt;(new Bar()) {</code>}.
</p></div>
</div>
</div>
<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->
<h2>Public Methods</h2>
<A NAME="equals(java.lang.Object)"></A>
<div class="jd-details api apilevel-Guice_2.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
boolean
</span>
<span class="sympad">equals</span>
<span class="normal">(Object o)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p></p></div>
</div>
</div>
<A NAME="get(com.google.inject.TypeLiteral<T>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type.
</p></div>
</div>
</div>
<A NAME="get(com.google.inject.TypeLiteral<T>, java.lang.Class<? extends java.lang.annotation.Annotation>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation type.
</p></div>
</div>
</div>
<A NAME="get(com.google.inject.TypeLiteral<T>, java.lang.annotation.Annotation)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; typeLiteral, Annotation annotation)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation.
</p></div>
</div>
</div>
<A NAME="get(java.lang.Class<T>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Class&lt;T&gt; type)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type.
</p></div>
</div>
</div>
<A NAME="get(java.lang.Class<T>, java.lang.Class<? extends java.lang.annotation.Annotation>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Class&lt;T&gt; type, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation type.
</p></div>
</div>
</div>
<A NAME="get(java.lang.Class<T>, java.lang.annotation.Annotation)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Class&lt;T&gt; type, Annotation annotation)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation.
</p></div>
</div>
</div>
<A NAME="get(java.lang.reflect.Type)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Type type)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type.
</p></div>
</div>
</div>
<A NAME="get(java.lang.reflect.Type, java.lang.Class<? extends java.lang.annotation.Annotation>)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Type type, Class&lt;?&nbsp;extends&nbsp;Annotation&gt; annotationType)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation type.
</p></div>
</div>
</div>
<A NAME="get(java.lang.reflect.Type, java.lang.annotation.Annotation)"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
static
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;
</span>
<span class="sympad">get</span>
<span class="normal">(Type type, Annotation annotation)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets a key for an injection type and an annotation.
</p></div>
</div>
</div>
<A NAME="getAnnotation()"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
Annotation
</span>
<span class="sympad">getAnnotation</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets the annotation.
</p></div>
</div>
</div>
<A NAME="getAnnotationType()"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
Class&lt;?&nbsp;extends&nbsp;Annotation&gt;
</span>
<span class="sympad">getAnnotationType</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets the annotation type.
</p></div>
</div>
</div>
<A NAME="getTypeLiteral()"></A>
<div class="jd-details api apilevel-Guice_1.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt;
</span>
<span class="sympad">getTypeLiteral</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_1.0">API Level Guice_1.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Gets the key type.
</p></div>
</div>
</div>
<A NAME="hasAttributes()"></A>
<div class="jd-details api apilevel-Guice_3.0">
<h4 class="jd-details-title">
<span class="normal">
public
boolean
</span>
<span class="sympad">hasAttributes</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_3.0">API Level Guice_3.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns true if this key has annotation attributes.</p></div>
</div>
</div>
<A NAME="hashCode()"></A>
<div class="jd-details api apilevel-Guice_2.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
int
</span>
<span class="sympad">hashCode</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p></p></div>
</div>
</div>
<A NAME="ofType(com.google.inject.TypeLiteral<T>)"></A>
<div class="jd-details api apilevel-Guice_3.0">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">ofType</span>
<span class="normal">(<a href="../../../com/google/inject/TypeLiteral.html">TypeLiteral</a>&lt;T&gt; type)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_3.0">API Level Guice_3.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a new key of the specified type with the same annotation as this
key.</p></div>
</div>
</div>
<A NAME="ofType(java.lang.Class<T>)"></A>
<div class="jd-details api apilevel-Guice_3.0">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">ofType</span>
<span class="normal">(Class&lt;T&gt; type)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_3.0">API Level Guice_3.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a new key of the specified type with the same annotation as this
key.</p></div>
</div>
</div>
<A NAME="ofType(java.lang.reflect.Type)"></A>
<div class="jd-details api apilevel-Guice_3.0">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="../../../com/google/inject/Key.html">Key</a>&lt;?&gt;
</span>
<span class="sympad">ofType</span>
<span class="normal">(Type type)</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_3.0">API Level Guice_3.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns a new key of the specified type with the same annotation as this
key.</p></div>
</div>
</div>
<A NAME="toString()"></A>
<div class="jd-details api apilevel-Guice_2.0">
<h4 class="jd-details-title">
<span class="normal">
public
final
String
</span>
<span class="sympad">toString</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_2.0">API Level Guice_2.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p></p></div>
</div>
</div>
<A NAME="withoutAttributes()"></A>
<div class="jd-details api apilevel-Guice_3.0">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="../../../com/google/inject/Key.html">Key</a>&lt;T&gt;
</span>
<span class="sympad">withoutAttributes</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div>
Since: <a href="../../../guide/appendix/api-levels.html#levelGuice_3.0">API Level Guice_3.0</a>
</div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Returns this key without annotation attributes, i.e. with only the
annotation type.</p></div>
</div>
</div>
<!-- ========= METHOD DETAIL ======== -->
<!-- ========= END OF CLASS DATA ========= -->
<A NAME="navbar_top"></A>
<div id="footer">
Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
</div> <!-- end footer -->
</div> <!-- jd-content -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script type="text/javascript">
init(); /* initialize android-developer-docs.js */
</script>
</body>
</html>