All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.semantickernel.implementation.CollectionUtil Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
// Copyright (c) Microsoft. All rights reserved.
package com.microsoft.semantickernel.implementation;

import java.util.List;
import javax.annotation.Nullable;

public class CollectionUtil {

    @Nullable
    public static  T getLastOrNull(
        @Nullable List collection) {
        if (collection == null || collection.isEmpty()) {
            return null;
        }

        return collection.get(collection.size() - 1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy