Enum ReferenceTypeAwareAssigner

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ReferenceTypeAwareAssigner>, Assigner

    public enum ReferenceTypeAwareAssigner
    extends java.lang.Enum<ReferenceTypeAwareAssigner>
    implements Assigner
    A simple assigner that is capable of handling the casting of reference types. Primitives can only be assigned to each other if they represent the same type.
    • Constructor Detail

      • ReferenceTypeAwareAssigner

        private ReferenceTypeAwareAssigner()
    • Method Detail

      • values

        public static ReferenceTypeAwareAssigner[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ReferenceTypeAwareAssigner c : ReferenceTypeAwareAssigner.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ReferenceTypeAwareAssigner valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • assign

        public StackManipulation assign​(TypeDescription.Generic source,
                                        TypeDescription.Generic target,
                                        Assigner.Typing typing)
        Specified by:
        assign in interface Assigner
        Parameters:
        source - The original type that is to be transformed into the targetType.
        target - The target type into which the sourceType is to be converted.
        typing - A hint whether the assignment should consider the runtime type of the source type, i.e. if type down or cross castings are allowed. If this hint is set, this is also an indication that void to non-void assignments are permitted.
        Returns:
        A stack manipulation that transforms the sourceType into the targetType if this is possible. An illegal stack manipulation otherwise.