Interface SubjectRef<I>
-
- Type Parameters:
I- identifier type
- All Known Subinterfaces:
SubjectRef.ToData<I>
@Immutable(builder=false) public interface SubjectRef<I>
A reference to a specific subject.- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSubjectRef.ToData<I>A resolved reference to a subject's data in a specific collection.
-
Field Summary
Fields Modifier and Type Field Description static io.leangen.geantyref.TypeToken<SubjectRef<?>>TYPE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Iidentifier()An identifier.static <I> SubjectRef<I>mapKeySafe(SubjectRef<I> existing)Return a sanitized subject reference that can safely be used as a map key.default StringserializedIdentifier()Compute the serialized form of the identifier.static <I> SubjectRef<I>subject(SubjectType<I> type, I identifier)Create a new subject reference.static <I> SubjectRef<I>subject(SubjectTypeCollection<I> type, I identifier)Create a new subject reference.SubjectType<I>type()The subject's type.
-
-
-
Field Detail
-
TYPE
static final io.leangen.geantyref.TypeToken<SubjectRef<?>> TYPE
-
-
Method Detail
-
subject
static <I> SubjectRef<I> subject(SubjectTypeCollection<I> type, I identifier)
Create a new subject reference.- Type Parameters:
I- the identifier type- Parameters:
type- the subject type's collectionidentifier- the subject's identifier- Returns:
- a new subject reference
- Since:
- 2.0.0
-
subject
static <I> SubjectRef<I> subject(SubjectType<I> type, I identifier)
Create a new subject reference.- Type Parameters:
I- the identifier type- Parameters:
type- the subject's typeidentifier- the subject's identifier- Returns:
- a new subject reference
- Since:
- 2.0.0
-
mapKeySafe
static <I> SubjectRef<I> mapKeySafe(SubjectRef<I> existing)
Return a sanitized subject reference that can safely be used as a map key.- Type Parameters:
I- the identifier type- Parameters:
existing- the existing reference- Returns:
- a sanitized reference
- Since:
- 2.0.0
-
type
@Parameter SubjectType<I> type()
The subject's type.- Returns:
- the type referred to.
- Since:
- 2.0.0
-
identifier
@Parameter I identifier()
An identifier.- Returns:
- the subject identifier
- Since:
- 2.0.0
-
serializedIdentifier
default String serializedIdentifier()
Compute the serialized form of the identifier.- Returns:
- the canonical serialized form of the subject identifier
-
-