Class Couple<T>

java.lang.Object
com.simibubi.create.foundation.utility.Pair<T,T>
com.simibubi.create.foundation.utility.Couple<T>
All Implemented Interfaces:
Iterable<T>

public class Couple<T> extends Pair<T,T> implements Iterable<T>
  • Constructor Details

    • Couple

      protected Couple(T first, T second)
  • Method Details

    • create

      public static <T> Couple<T> create(T first, T second)
    • create

      public static <T> Couple<T> create(Supplier<T> factory)
    • createWithContext

      public static <T> Couple<T> createWithContext(Function<Boolean,T> factory)
    • get

      public T get(boolean first)
    • set

      public void set(boolean first, T value)
    • copy

      public Couple<T> copy()
      Overrides:
      copy in class Pair<T,T>
    • map

      public <S> Couple<S> map(Function<T,S> function)
    • mapWithContext

      public <S> Couple<S> mapWithContext(BiFunction<T,Boolean,S> function)
    • mapWithParams

      public <S, R> Couple<S> mapWithParams(BiFunction<T,R,S> function, Couple<R> values)
    • mapNotNullWithParam

      public <S, R> Couple<S> mapNotNullWithParam(BiFunction<T,R,S> function, R value)
    • both

      public boolean both(Predicate<T> test)
    • either

      public boolean either(Predicate<T> test)
    • replace

      public void replace(Function<T,T> function)
    • replaceWithContext

      public void replaceWithContext(BiFunction<T,Boolean,T> function)
    • replaceWithParams

      public <S> void replaceWithParams(BiFunction<T,S,T> function, Couple<S> values)
    • forEach

      public void forEach(Consumer<? super T> consumer)
      Specified by:
      forEach in interface Iterable<T>
    • forEachWithContext

      public void forEachWithContext(BiConsumer<T,Boolean> consumer)
    • forEachWithParams

      public <S> void forEachWithParams(BiConsumer<T,S> function, Couple<S> values)
    • swap

      public Couple<T> swap()
      Overrides:
      swap in class Pair<T,T>
    • serializeEach

      public net.minecraft.nbt.ListTag serializeEach(Function<T,net.minecraft.nbt.CompoundTag> serializer)
    • deserializeEach

      public static <S> Couple<S> deserializeEach(net.minecraft.nbt.ListTag list, Function<net.minecraft.nbt.CompoundTag,S> deserializer)
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • stream

      public Stream<T> stream()