com.speedment.common.tuple.internal.nullable.mapper.Tuple3OfNullablesMapperImpl Maven / Gradle / Ivy
Show all versions of tuple Show documentation
/*
*
* Copyright (c) 2006-2019, Speedment, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.speedment.common.tuple.internal.nullable.mapper;
import com.speedment.common.tuple.Tuple3;
import com.speedment.common.tuple.TupleMapper;
import com.speedment.common.tuple.TuplesOfNullables;
import com.speedment.common.tuple.internal.AbstractTupleMapper;
import com.speedment.common.tuple.nullable.Tuple3OfNullables;
import java.util.function.Function;
/**
* An implementation class of a {@link TupleMapper } of degree 3
*
* Generated by com.speedment.sources.pattern.tuple.TupleMapperImplPattern
*
* @param Type of the original object for the mapper to use when creating a
* {@code Tuple }
* @param type of element 0
* @param type of element 1
* @param type of element 2
*
* @author Per Minborg
*/
public final class Tuple3OfNullablesMapperImpl
extends AbstractTupleMapper>
implements TupleMapper> {
/**
* Constructs a {@link TupleMapper } that can create {@link Tuple3 }.
*
* @param m0 mapper to apply for element 0
* @param m1 mapper to apply for element 1
* @param m2 mapper to apply for element 2
*/
public Tuple3OfNullablesMapperImpl(
Function m0,
Function m1,
Function m2) {
super(3);
set(0, m0);
set(1, m1);
set(2, m2);
}
@Override
public Tuple3OfNullables apply(T t) {
return TuplesOfNullables.ofNullables(
get0().apply(t),
get1().apply(t),
get2().apply(t)
);
}
public Function get0() {
return getAndCast(0);
}
public Function get1() {
return getAndCast(1);
}
public Function get2() {
return getAndCast(2);
}
}