Enum PrimitiveNarrowingDelegate

java.lang.Object
java.lang.Enum<PrimitiveNarrowingDelegate>
net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveNarrowingDelegate
All Implemented Interfaces:
Serializable, Comparable<PrimitiveNarrowingDelegate>, java.lang.constant.Constable

public enum PrimitiveNarrowingDelegate extends Enum<PrimitiveNarrowingDelegate>
This delegate is responsible for narrowing a primitive type to represent a smaller primitive type. The rules for this narrowing are equivalent to those in the JLS. This class also includes the byte-to-char conversion in widening and narrowing primitive conversions.
  • Enum Constant Details

  • Method Details

    • values

      public static PrimitiveNarrowingDelegate[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PrimitiveNarrowingDelegate valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • forPrimitive

      public static PrimitiveNarrowingDelegate forPrimitive(TypeDefinition typeDefinition)
      Locates the delegate that is capable of narrowing the given type into another type.
      Parameters:
      typeDefinition - A non-void primitive type that is to be narrowed into another type.
      Returns:
      A delegate for the given type.
    • narrowTo

      public StackManipulation narrowTo(TypeDefinition typeDefinition)
      Attempts to narrow the represented type into another type.
      Parameters:
      typeDefinition - A non-void primitive type that is the expected result of the narrowing operation.
      Returns:
      A narrowing instruction or an illegal stack manipulation if such narrowing is not legitimate.