public final class UnmodifiableScopeKey extends ScopeKey implements Serializable, Cloneable
DEFAULT_SCOPE
Constructor and Description |
---|
UnmodifiableScopeKey(Collection<Scope> scopes)
Create a new ScopeKey.
|
UnmodifiableScopeKey(int max,
Scope... scopes)
Create a new ScopeKey.
|
UnmodifiableScopeKey(Scope... scopes)
Create a new ScopeKey.
|
UnmodifiableScopeKey(ScopeKey key) |
UnmodifiableScopeKey(ScopeLevel level,
Object qualifier)
Create a new ScopeKey.
|
Modifier and Type | Method and Description |
---|---|
Scope |
addScope(Scope scope)
Scope cannot be added to an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey).
|
Scope |
addScope(ScopeLevel level,
Object qualifier)
Scope cannot be added to an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey).
|
ScopeKey |
clone()
clone will always return a frozen copy of the UnmodifiableScopeKey.
|
boolean |
equals(Object object) |
void |
freeze()
This method is ignored as UnmodifiableScopeKey is always frozen
|
protected Scope[] |
getArray() |
ScopeLevel |
getMaxScopeLevel()
Get the maximum scope level
|
ScopeKey |
getOptimizedKey()
The returned ScopeKey is immutable and optimized for use at runtime.
|
ScopeKey |
getParent()
Get the parent scope key
|
Scope |
getScope(ScopeLevel level)
Get a scope
|
Scope |
getScopeLevel(ScopeLevel scopeLevel)
Get scope for the specified scopeLevel
|
Collection<Scope> |
getScopes()
Get the scopes
|
protected Collection<Scope> |
getScopesCollection() |
int |
hashCode() |
boolean |
isFrozen()
Get the frozen.
|
boolean |
isParent(ScopeKey key)
Is this parent of key parameter.
|
Scope |
removeScope(Scope scope)
Scope cannot be removed from an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey).
|
Scope |
removeScopeLevel(ScopeLevel scopeLevel)
ScopeLevel cannot be removed from an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey).
|
String |
toString() |
computeHashCode, computeHashCode
public UnmodifiableScopeKey(ScopeKey key)
public UnmodifiableScopeKey(ScopeLevel level, Object qualifier)
level
- the scope levelqualifier
- the scope qualifierpublic UnmodifiableScopeKey(Collection<Scope> scopes)
scopes
- is a collection of Scope instances that make up the represented pathIllegalArgumentException
- if parameter scopes is nullpublic UnmodifiableScopeKey(Scope... scopes)
scopes
- is zero or more Scope instances that make up the represented pathIllegalArgumentException
- if parameter scopes is nullpublic UnmodifiableScopeKey(int max, Scope... scopes)
max
- number of passed Scope instances to usescopes
- is zero or more Scope instances that make up the represented pathIllegalArgumentException
- if parameter scopes is nullpublic ScopeKey getOptimizedKey()
ScopeKey
getOptimizedKey
in class ScopeKey
public Collection<Scope> getScopes()
public Scope getScope(ScopeLevel level)
getScope
in class ScopeKey
level
- the scope levelIllegalArgumentException
- if level is null.public ScopeLevel getMaxScopeLevel()
getMaxScopeLevel
in class ScopeKey
public ScopeKey getParent()
public boolean isParent(ScopeKey key)
isParent
in class ScopeKey
key
- the key parameterIllegalArgumentException
- if parameter key is nullpublic Scope getScopeLevel(ScopeLevel scopeLevel)
getScopeLevel
in class ScopeKey
scopeLevel
- the scope levelIllegalArgumentException
- if parameter scopeLevel is nullpublic boolean isFrozen()
public void freeze()
public Scope addScope(Scope scope)
addScope
in class ScopeKey
scope
- the scopeIllegalArgumentException
- if scope is null.IllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope addScope(ScopeLevel level, Object qualifier)
addScope
in class ScopeKey
level
- the scope levelqualifier
- the scope qualifierIllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope removeScope(Scope scope)
removeScope
in class ScopeKey
scope
- the scopeIllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope removeScopeLevel(ScopeLevel scopeLevel)
removeScopeLevel
in class ScopeKey
scopeLevel
- the scopeLevelIllegalStateException
- because UnmodifiableScopeKey is always frozenpublic ScopeKey clone()
protected Collection<Scope> getScopesCollection()
getScopesCollection
in class ScopeKey
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.