Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// ============================================================================
// Copyright (c) 2017-2021 Nawapunth Manusitthipol (NawaMan - http://nawaman.net).
// ----------------------------------------------------------------------------
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// ============================================================================
package functionalj.tuple;
import static functionalj.function.Absent.__;
import static functionalj.function.Func.it;
import static functionalj.tuple.Keep.keep;
import java.lang.reflect.Array;
import java.util.function.Function;
import functionalj.function.Absent;
import functionalj.function.Func2;
import functionalj.function.Func3;
import functionalj.list.FuncList;
import functionalj.map.FuncMap;
import functionalj.map.ImmutableFuncMap;
import functionalj.pipeable.Pipeable;
import lombok.val;
public interface Tuple3 extends Pipeable> {
public static Tuple3 of(T1 _1, T2 _2, T3 _3) {
return new ImmutableTuple3<>(_1, _2, _3);
}
public T1 _1();
public T2 _2();
public T3 _3();
@Override
public default Tuple3 __data() {
return this;
}
public default ImmutableTuple3 toImmutableTuple() {
return ImmutableTuple.of(this);
}
public default Object[] toArray() {
val _1 = _1();
val _2 = _2();
val _3 = _3();
return new Object[] { _1, _2, _3 };
}
public default T[] toArray(Class type) {
val _1 = _1();
val _2 = _2();
val _3 = _3();
val array = Array.newInstance(type, 3);
Array.set(array, 0, _1);
Array.set(array, 1, _2);
Array.set(array, 2, _3);
@SuppressWarnings("unchecked")
val toArray = (T[])array;
return toArray;
}
public default FuncList