Class ToDataSubjectRefImpl<I>
- java.lang.Object
-
- ca.stellardrift.permissionsex.impl.subject.ToDataSubjectRefImpl<I>
-
- All Implemented Interfaces:
ca.stellardrift.permissionsex.subject.SubjectRef<I>,ca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>,Consumer<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>
public class ToDataSubjectRefImpl<I> extends Object implements Consumer<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>, ca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
An automatically updating reference to the latest data for a certain subject.- Since:
- 2.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ca.stellardrift.permissionsex.subject.SubjectRef
ca.stellardrift.permissionsex.subject.SubjectRef.ToData<I extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ca.stellardrift.permissionsex.subject.ImmutableSubjectData newData)ca.stellardrift.permissionsex.subject.ImmutableSubjectDataget()SubjectDataCacheImpl<I>getCache()Get the cache this subject is held in.booleanholdsListenersStrongly()Iidentifier()CompletableFuture<Boolean>isRegistered()voidonUpdate(Consumer<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> listener)CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>remove()ca.stellardrift.permissionsex.subject.SubjectType<I>type()CompletableFuture<ca.stellardrift.permissionsex.util.Change<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>>update(UnaryOperator<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> modifierFunc)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
type
public ca.stellardrift.permissionsex.subject.SubjectType<I> type()
- Specified by:
typein interfaceca.stellardrift.permissionsex.subject.SubjectRef<I>
-
identifier
public I identifier()
- Specified by:
identifierin interfaceca.stellardrift.permissionsex.subject.SubjectRef<I>
-
get
public ca.stellardrift.permissionsex.subject.ImmutableSubjectData get()
- Specified by:
getin interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
update
public CompletableFuture<ca.stellardrift.permissionsex.util.Change<ca.stellardrift.permissionsex.subject.ImmutableSubjectData>> update(UnaryOperator<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> modifierFunc)
- Specified by:
updatein interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
accept
public void accept(ca.stellardrift.permissionsex.subject.ImmutableSubjectData newData)
-
holdsListenersStrongly
public boolean holdsListenersStrongly()
- Specified by:
holdsListenersStronglyin interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
onUpdate
public void onUpdate(Consumer<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> listener)
- Specified by:
onUpdatein interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
getCache
public SubjectDataCacheImpl<I> getCache()
Get the cache this subject is held in.- Returns:
- The cache holding this data
-
isRegistered
public CompletableFuture<Boolean> isRegistered()
- Specified by:
isRegisteredin interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
remove
public CompletableFuture<ca.stellardrift.permissionsex.subject.ImmutableSubjectData> remove()
- Specified by:
removein interfaceca.stellardrift.permissionsex.subject.SubjectRef.ToData<I>
-
-