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
    • 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 collection
        identifier - 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 type
        identifier - 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<Itype()
        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