public class ScopedKey<S extends Serializable> extends AbstractScopedKey
hashCode() and
equals(Object) method based on the scope and the current value.| Constructor and Description |
|---|
ScopedKey(S key) |
ScopedKey(String scope,
S key) |
| Modifier and Type | Method and Description |
|---|---|
static <S extends Serializable> |
create(S key)
Create a scoped key from a key, the scope value is obtained from the
ScopeManager.getCurrentScope() method. |
static <S extends Serializable> |
create(String scope,
S key)
Creates a new scoped key with an explicit scope value.
|
boolean |
equals(Object obj)
Returns true when:
the obj argument has the same reference than this object
or the obj has class equality (
getClass().equals(obj.getClass())) and scope equality
Subclasses should override this method and call the super method to ensure that the objects are of the same class and
have the same scope. |
S |
getKey() |
int |
hashCode()
Returns the scope value hashCode.
|
String |
toString() |
getScopepublic ScopedKey(S key) throws NullPointerException
NullPointerExceptionpublic ScopedKey(String scope, S key) throws NullPointerException
NullPointerExceptionpublic static <S extends Serializable> ScopedKey<S> create(S key) throws NullPointerException
ScopeManager.getCurrentScope() method.S - the key generic serializable typekey - the local keyNullPointerException - if the key argument is nullpublic static <S extends Serializable> ScopedKey<S> create(String scope, S key) throws NullPointerException
S - the key generic serializable typescope - the scope valuekey - the keyNullPointerException - if any argument is nullpublic S getKey()
public int hashCode()
AbstractScopedKeyhashCode in class AbstractScopedKeypublic boolean equals(Object obj)
AbstractScopedKeygetClass().equals(obj.getClass())) and scope equalityequals in class AbstractScopedKeyCopyright © 2017 JBoss by Red Hat. All Rights Reserved.