
com.redis.om.spring.tuple.Decuple Maven / Gradle / Ivy
package com.redis.om.spring.tuple;
import com.redis.om.spring.tuple.accessor.EighthAccessor;
import com.redis.om.spring.tuple.accessor.FifthAccessor;
import com.redis.om.spring.tuple.accessor.FirstAccessor;
import com.redis.om.spring.tuple.accessor.FourthAccessor;
import com.redis.om.spring.tuple.accessor.NinthAccessor;
import com.redis.om.spring.tuple.accessor.SecondAccessor;
import com.redis.om.spring.tuple.accessor.SeventhAccessor;
import com.redis.om.spring.tuple.accessor.SixthAccessor;
import com.redis.om.spring.tuple.accessor.TenthAccessor;
import com.redis.om.spring.tuple.accessor.ThirdAccessor;
public interface Decuple extends Tuple {
T0 getFirst();
T1 getSecond();
T2 getThird();
T3 getFourth();
T4 getFifth();
T5 getSixth();
T6 getSeventh();
T7 getEighth();
T8 getNinth();
T9 getTenth();
@Override
default int size() {
return 10;
}
default Object get(int index) {
switch (index) {
case 0:
return getFirst();
case 1:
return getSecond();
case 2:
return getThird();
case 3:
return getFourth();
case 4:
return getFifth();
case 5:
return getSixth();
case 6:
return getSeventh();
case 7:
return getEighth();
case 8:
return getNinth();
case 9:
return getTenth();
default:
throw new IndexOutOfBoundsException(
String.format("Index %d is outside bounds of tuple of degree %s", index, size()));
}
}
static FirstAccessor, T0> getFirstGetter() {
return Decuple::getFirst;
}
static SecondAccessor, T1> getSecondGetter() {
return Decuple::getSecond;
}
static ThirdAccessor, T2> getThirdGetter() {
return Decuple::getThird;
}
static FourthAccessor, T3> getFourthGetter() {
return Decuple::getFourth;
}
static FifthAccessor, T4> getFifthGetter() {
return Decuple::getFifth;
}
static SixthAccessor, T5> getSixthGetter() {
return Decuple::getSixth;
}
static SeventhAccessor, T6> getSeventhGetter() {
return Decuple::getSeventh;
}
static EighthAccessor, T7> getEighthGetter() {
return Decuple::getEighth;
}
static NinthAccessor, T8> getNinthGetter() {
return Decuple::getNinth;
}
static TenthAccessor, T9> getTenthGetter() {
return Decuple::getTenth;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy