com.microsoft.semantickernel.implementation.CollectionUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of semantickernel-api Show documentation
Show all versions of semantickernel-api Show documentation
Defines the public interface for the Semantic Kernel
// 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);
}
}