
com.redis.om.spring.tuple.Nonuple 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.ThirdAccessor;
public interface Nonuple extends Tuple {
E1 getFirst();
E2 getSecond();
E3 getThird();
E4 getFourth();
E5 getFifth();
E6 getSixth();
E7 getSeventh();
E8 getEighth();
E9 getNinth();
@Override
default int size() {
return 9;
}
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();
default:
throw new IndexOutOfBoundsException(
String.format("Index %d is outside bounds of tuple of degree %s", index, size()));
}
}
static FirstAccessor, E1> getFirstGetter() {
return Nonuple::getFirst;
}
static SecondAccessor, E2> getSecondGetter() {
return Nonuple::getSecond;
}
static ThirdAccessor, E3> getThirdGetter() {
return Nonuple::getThird;
}
static FourthAccessor, E4> getFourthGetter() {
return Nonuple::getFourth;
}
static FifthAccessor, E5> getFifthGetter() {
return Nonuple::getFifth;
}
static SixthAccessor, E6> getSixthGetter() {
return Nonuple::getSixth;
}
static SeventhAccessor, E7> getSeventhGetter() {
return Nonuple::getSeventh;
}
static EighthAccessor, E8> getEighthGetter() {
return Nonuple::getEighth;
}
static NinthAccessor, E9> getNinthGetter() {
return Nonuple::getNinth;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy