FreezableUtils

Kotlin|Java

public final classFreezableUtils


Utilities for working withFreezable objects.

Summary

Public constructors

Public methods

staticArrayList<T>
<T, E extends Freezable<T>>freeze(E[] array)

Utility helper method to freeze an array of freezable entities into a list of concrete entities.

staticArrayList<T>
<T, E extends Freezable<T>>freeze(ArrayList<E> list)

Utility helper method to freeze a list of freezable entities into a list of concrete entities.

staticArrayList<T>
<T, E extends Freezable<T>>freezeIterable(Iterable<E> iterable)

Utility helper method to freeze an array of freezable entities into a list of concrete entities.

Public constructors

FreezableUtils

public FreezableUtils()

Public methods

freeze

public static ArrayList<T> <T, E extends Freezable<T>>freeze(E[] array)

Utility helper method to freeze an array of freezable entities into a list of concrete entities. The array provided here must contain elements that implement theFreezable interface.

Type T is the type of object returned by freezing an element of the array. In most cases, this will be the same asE.

Type E is the type of object contained in the array. Must implementFreezable.

Parameters
E[] array

Array to freeze contents from.

Returns
ArrayList<T>

ArrayList of frozen representations of the object present in the provided array.

freeze

public static ArrayList<T> <T, E extends Freezable<T>>freeze(ArrayList<E> list)

Utility helper method to freeze a list of freezable entities into a list of concrete entities. The list provided here must contain elements that implement theFreezable interface.

Type T is the type of object returned by freezing an element of the list. In most cases, this will be the same asE.

Type E is the type of object contained in the list. Must implementFreezable.

Parameters
ArrayList<E> list

ArrayList to freeze contents from.

Returns
ArrayList<T>

ArrayList of frozen representations of the object present in the provided list.

freezeIterable

public static ArrayList<T> <T, E extends Freezable<T>>freezeIterable(Iterable<E> iterable)

Utility helper method to freeze an array of freezable entities into a list of concrete entities. The array provided here must contain elements that implement theFreezable interface.

Type T is the type of object returned by freezing an element of the array. In most cases, this will be the same asE.

Type E is the type of object contained in the array. Must implementFreezable.

Parameters
Iterable<E> iterable

Iterable to freeze contents from.

Returns
ArrayList<T>

ArrayList of frozen representations of the object present in the provided array.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.