Class PrimitiveLongList

java.lang.Object
io.opentelemetry.sdk.internal.PrimitiveLongList

public final class PrimitiveLongList extends Object
A list of longs backed by, and exposing, an array of primitives. Values will be boxed on demand when using standard List operations. Operations should generally use the static methods in this class to operate directly on the backing array instead. The idea is that in almost all apps, the list will only be accessed by our internal code, and if it does happen to be used elsewhere, performance of on-demand boxing isn't prohibitive while still providing expected ergonomics.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Constructor Details

    • PrimitiveLongList

      private PrimitiveLongList()
  • Method Details

    • wrap

      public static List<Long> wrap(long[] values)
      Returns a list that wraps the primitive array. Modifications in the array will be visible in the list.
    • toArray

      public static long[] toArray(List<Long> list)
      Returns a primitive array with the values of the list. The list should generally have been created with wrap(long[]).