Advertisement
GenuineSounds

BiReturn

Jan 8th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package com.genuine.conjure.util;
  2.  
  3. import java.util.Optional;
  4.  
  5. public final class BiReturn<V1, V2> {
  6.  
  7.     public static <A, B> BiReturn<A, B> of(A v1, B v2) {
  8.         return new BiReturn<A, B>(v1, v2);
  9.     }
  10.  
  11.     private final Optional<V1> v1;
  12.     private final Optional<V2> v2;
  13.  
  14.     public BiReturn(V1 v1, V2 v2) {
  15.         this.v1 = Optional.of(v1);
  16.         this.v2 = Optional.of(v2);
  17.     }
  18.  
  19.     public Optional<V1> getValue1() {
  20.         return v1;
  21.     }
  22.  
  23.     public Optional<V2> getValue2() {
  24.         return v2;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement