Class Java8Compat

java.lang.Object
com.google.genai.gaos.utils.Java8Compat

public final class Java8Compat extends Object
Java 8 replacements for JDK 9+ APIs used by the generated SDK.
  • Method Details

    • or

      public static <T> Optional<T> or(Optional<T> optional, Supplier<? extends Optional<? extends T>> supplier)
    • isBlank

      public static boolean isBlank(String s)
    • listOf

      @SafeVarargs public static <T> List<T> listOf(T... elements)
    • setOf

      @SafeVarargs public static <T> Set<T> setOf(T... elements)
    • mapOf

      public static <K, V> Map<K,V> mapOf()
    • mapOf

      public static <K, V> Map<K,V> mapOf(K k1, V v1)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K k1, V v1, K k2, V v2)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K k1, V v1, K k2, V v2, K k3, V v3)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    • mapOfEntries

      @SafeVarargs public static <K, V> Map<K,V> mapOfEntries(Map.Entry<? extends K,? extends V>... entries)
    • mapEntry

      public static <K, V> Map.Entry<K,V> mapEntry(K key, V value)
    • setCopyOf

      public static <T> Set<T> setCopyOf(Collection<? extends T> collection)
    • writeString

      public static Path writeString(Path path, CharSequence content, OpenOption... options) throws IOException
      Throws:
      IOException
    • stream

      public static <T> Stream<T> stream(Optional<T> optional)
    • streamOfNullable

      public static <T> Stream<T> streamOfNullable(T value)
      Java 8 replacement for Stream.ofNullable (Java 9+).
    • failedFuture

      public static <T> CompletableFuture<T> failedFuture(Throwable ex)
      Java 8 replacement for CompletableFuture.failedFuture (Java 9+).