Class JavaConstant.Simple.OfTrivialValue<S>

    • Constructor Detail

      • OfTrivialValue

        protected OfTrivialValue​(S value,
                                 TypeDescription typeDescription)
        Creates a representation of a trivial constant that represents itself.
        Parameters:
        value - The represented value.
        typeDescription - The represented value's type.
    • Method Detail

      • toDescription

        public java.lang.Object toDescription()
        Returns this constant as a Java java.lang.constant.ConstantDesc if the current VM is of at least version 12. If the current VM is of an older version and does not support the type, an exception is thrown.
        Returns:
        This constant as a Java java.lang.constant.ConstantDesc.
      • accept

        public <T> T accept​(JavaConstant.Visitor<T> visitor)
        Applies the supplied visitor to this constant type with its respective callback.
        Type Parameters:
        T - The type of the value that is returned by the visitor.
        Parameters:
        visitor - The visitor to dispatch.
        Returns:
        The value that is returned by the supplied visitor.