Class AnnotationValue.ArrayValue

    • Constructor Detail

      • ArrayValue

        ArrayValue​(java.lang.String name,
                   AnnotationValue[] value)
    • Method Detail

      • value

        public AnnotationValue[] value()
        Description copied from class: AnnotationValue
        Returns a detyped value that represents the underlying annotation value. It is recommended that the type specific methods be used instead.
        Specified by:
        value in class AnnotationValue
        Returns:
        the underlying value
      • kind

        public AnnotationValue.Kind kind()
        Description copied from class: AnnotationValue
        Returns the kind of this value. The kind includes all Java primitives, String and Enum types, nested values, and finally arrays of the above. Since the return type is itself an enumeration, it can be used with Java switch statements.

        A special AnnotationValue.Kind.UNKNOWN kind is used to refer to components of zero-length arrays, as the underlying type is not known.

        Specified by:
        kind in class AnnotationValue
        Returns:
        the kind of value
      • asIntArray

        public int[] asIntArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive integer array.
        Overrides:
        asIntArray in class AnnotationValue
        Returns:
        an int array that represents this value
      • asLongArray

        public long[] asLongArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive long array.
        Overrides:
        asLongArray in class AnnotationValue
        Returns:
        a long array that represents this value
      • asShortArray

        public short[] asShortArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive short array.
        Overrides:
        asShortArray in class AnnotationValue
        Returns:
        a short array that represents this value
      • asByteArray

        public byte[] asByteArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive byte array.
        Overrides:
        asByteArray in class AnnotationValue
        Returns:
        a byte array that represents this value
      • asFloatArray

        public float[] asFloatArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive float array.
        Overrides:
        asFloatArray in class AnnotationValue
        Returns:
        a float array that represents this value
      • asDoubleArray

        public double[] asDoubleArray()
        Description copied from class: AnnotationValue
        Converts an underlying numerical array to a Java primitive double array.
        Overrides:
        asDoubleArray in class AnnotationValue
        Returns:
        a double array that represents this value
      • asCharArray

        public char[] asCharArray()
        Description copied from class: AnnotationValue
        Returns the underlying character array.
        Overrides:
        asCharArray in class AnnotationValue
        Returns:
        a character array that represents this value
      • asBooleanArray

        public boolean[] asBooleanArray()
        Description copied from class: AnnotationValue
        Returns the underlying boolean array.
        Overrides:
        asBooleanArray in class AnnotationValue
        Returns:
        a boolean array that represents this value
      • asStringArray

        public java.lang.String[] asStringArray()
        Description copied from class: AnnotationValue
        Returns a string array representation of the underlying array value. The behavior is identical to AnnotationValue.asString() as if it were applied to every array element.
        Overrides:
        asStringArray in class AnnotationValue
        Returns:
        a string array representing the underlying array value
      • asEnumArray

        public java.lang.String[] asEnumArray()
        Description copied from class: AnnotationValue
        Returns an array of the constant name, in string form, that represents the Java enumeration of each array element The individual element values are the same as the one returned by Enum.name().
        Overrides:
        asEnumArray in class AnnotationValue
        Returns:
        an array of string names of a Java enums
      • asEnumTypeArray

        public DotName[] asEnumTypeArray()
        Description copied from class: AnnotationValue
        Returns an array of the type name, in DotName form, that represents the Java enumeration of each array element. The individual element values are the same as the one returned by Object.getClass(). Note that JLS restricts an enum array parameter to the same type. Also, when an empty array is specified in a value, it's types can not be determined.
        Overrides:
        asEnumTypeArray in class AnnotationValue
        Returns:
        an array of string type names of Java enum array elements
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: AnnotationValue
        Compares this annotation value to another annotation value, and returns true if equal.
        Overrides:
        equals in class AnnotationValue
        Parameters:
        o - the annotation value to compare to.
        Returns:
        true if equal, false if not
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        Description copied from class: AnnotationValue
        Computes a hash code for this annotation value.
        Overrides:
        hashCode in class AnnotationValue
        Returns:
        the hash code for this annotation value
        See Also:
        Object.hashCode()