Docsite Title > com.package1 > com.package1.classMethodTypeAnnotations

# TypeAnnotations1.2.3

- Methods

class TypeAnnotations

Known subtypes in package:
Known usages in package:
All versions:

## Methods(show inherited)

- link
  function
  Any.getClass(): Class<this> (pkl.base) Source

  Returns the class of `this`.

- expand_more link
  function
  Any.toString(): String (pkl.base) Source

  Returns a string representation of `this`.

  This method is used to convert the values of string interpolation expressions to strings.

- expand_more link
  function
  Any.ifNonNull<Result>(transform: (this) -> Result): Result? (pkl.base) Source

  Returns `this |> transform` if `this` is non-null, and `null` otherwise.

  This method is the complement of the `??` operator and the equivalent of an `Option` type's `map` and `flatMap` methods.

- link
  function
  Typed.hasProperty(name: String): Boolean (pkl.base) Source

  Tells if this object has a property with the given `name`.

- expand_more link
  function
  Typed.getProperty(name: String): unknown (pkl.base) Source

  Returns the value of the property with the given `name`.

  Throws if a property with this name does not exist.

- expand_more link
  function
  Typed.getPropertyOrNull(name: String): unknown? (pkl.base) Source

  Returns the value of the property with the given `name`.

  Returns `null` if a property with this name does not exist.

- link
  function
  Typed.toDynamic(): Dynamic (pkl.base) Source

  Converts this object to a `Dynamic` object.

- link
  function
  Typed.toMap(): Map<String, unknown> (pkl.base) Source

  Converts this object to a `Map`.

- link
  function
  method1(): unknownSource

  Zero-arg method without declared types.

- link
  function
  method2(arg1: unknown): unknownSource

  One-arg method without declared types.

- link
  function
  method3(arg1: unknown, arg2: unknown): unknownSource

  Two-arg method without declared types.

- link
  function
  method4(): String Source

  Zero-arg method with simple types.

- link
  function
  method5(arg1: Boolean): Int Source

  One-arg method with simple types.

- link
  function
  method6(arg1: Int, arg2: Float): Duration Source

  Two-arg method with simple types.

- link
  function
  method7(arg1: List<Int>, arg2: List<Float>): List<Duration>Source

  Two-arg method with list types.

- link
  function
  method8(arg1: Set<Int>, arg2: Set<Float>): Set<Duration>Source

  Two-arg method with set types.

- link
  function
  method9(arg1: Map<Int, Int>, arg2: Map<Float, Float>): Map<Duration, Duration>Source

  Two-arg method with map types.

- link
  function
  method10(arg1: Int?, arg2: Float?): Duration?Source

  Two-arg method with optional types.

- link
  function
  method11(arg1: () -> Int, arg2: (Int) -> Float): (Int, Float) -> Duration Source

  Two-arg method with function types.

- link
  function
  method12(arg1: String, arg2: unknown): Boolean Source

  Two-arg method with partially declared types.

- link
  function
  method13(arg1: Map<List<String?>?, (Boolean?) -> Map<Int, Float>>): Map<List<Duration?>?, (DataSize?) -> Map<Any, Number>>Source

  One-arg method with complex types.