Record Class CalleeBounds

java.lang.Object
java.lang.Record
io.micronaut.sourcegen.generator.CalleeBounds
Record Components:
variables - The type variables the invoked method declares
receiverArguments - The type arguments the receiver binds the variables of the method's class with
raw - Whether a bound naming a variable of the method is written raw, rather than with Object for the variable

@Internal public record CalleeBounds(List<TypeDef.TypeVariable> variables, Map<String,TypeDef> receiverArguments, boolean raw) extends Record
The bounds of the type variables an invoked method declares, as they read where the method is called: a variable of the caller can have the same name as one of the method, which is out of scope there.

A variable of the method is its bounds - following a bound that is another variable of the method - with the receiver's type arguments for the variables of its class. A bound that names a variable of the method itself, `Comparable`, is raw for Java, and has the variable as `Object` for Kotlin, which has no raw types.

Since:
2.3
  • Constructor Details

    • CalleeBounds

      public CalleeBounds(List<TypeDef.TypeVariable> variables, Map<String,TypeDef> receiverArguments, boolean raw)
      Creates an instance of a CalleeBounds record class.
      Parameters:
      variables - the value for the variables record component
      receiverArguments - the value for the receiverArguments record component
      raw - the value for the raw record component
  • Method Details

    • names

      public boolean names(TypeDef type)
      Whether a type names a variable of the invoked method.
      Parameters:
      type - The type
      Returns:
      true where it does
    • of

      public List<TypeDef> of(TypeDef type)
      A type without the variables of the invoked method: a variable is its bounds, an array one of the arrays of its component's first bound, and a parameterization raw for Java, or with each variable its first bound for Kotlin.
      Parameters:
      type - The type
      Returns:
      The types the type is, more than one for a variable of several bounds
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • variables

      public List<TypeDef.TypeVariable> variables()
      Returns the value of the variables record component.
      Returns:
      the value of the variables record component
    • receiverArguments

      public Map<String,TypeDef> receiverArguments()
      Returns the value of the receiverArguments record component.
      Returns:
      the value of the receiverArguments record component
    • raw

      public boolean raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component