Search in sources :

Example 1 with FixieFun6

use of primal.adt.Fixie_.FixieFun6 in project suite by stupidsing.

the class MapObject_ method list.

public static <T extends MapObject<T>> List<?> list(Object object) {
    Class<?> clazz = object.getClass();
    Method m = // 
    Read.from(// 
    clazz.getMethods()).filter(// 
    method -> String_.equals(method.getName(), "apply")).uniqueResult();
    Class<?> type = m.getParameters()[0].getType();
    Object p;
    if (type == FixieFun0.class)
        p = (FixieFun0<?>) List::of;
    else if (type == FixieFun1.class)
        p = (FixieFun1<?, ?>) List::of;
    else if (type == FixieFun2.class)
        p = (FixieFun2<?, ?, ?>) List::of;
    else if (type == FixieFun3.class)
        p = (FixieFun3<?, ?, ?, ?>) List::of;
    else if (type == FixieFun4.class)
        p = (FixieFun4<?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFun5.class)
        p = (FixieFun5<?, ?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFun6.class)
        p = (FixieFun6<?, ?, ?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFun7.class)
        p = (FixieFun7<?, ?, ?, ?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFun8.class)
        p = (FixieFun8<?, ?, ?, ?, ?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFun9.class)
        p = (FixieFun9<?, ?, ?, ?, ?, ?, ?, ?, ?, ?>) List::of;
    else if (type == FixieFunA.class)
        p = (FixieFunA<?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?>) List::of;
    else
        p = Fail.t();
    return (List<?>) Rethrow.ex(() -> m.invoke(object, p));
}
Also used : Read(suite.streamlet.Read) Iterator(java.util.Iterator) FixieFunA(suite.adt.pair.Fixie_.FixieFunA) Objects(java.util.Objects) List(java.util.List) FixieFun9(suite.adt.pair.Fixie_.FixieFun9) FixieFun7(suite.adt.pair.Fixie_.FixieFun7) FixieFun8(suite.adt.pair.Fixie_.FixieFun8) FixieFun5(suite.adt.pair.Fixie_.FixieFun5) FixieFun6(suite.adt.pair.Fixie_.FixieFun6) FixieFun3(suite.adt.pair.Fixie_.FixieFun3) FixieFun4(suite.adt.pair.Fixie_.FixieFun4) FixieFun1(suite.adt.pair.Fixie_.FixieFun1) FixieFun2(suite.adt.pair.Fixie_.FixieFun2) Method(java.lang.reflect.Method) FixieFun0(suite.adt.pair.Fixie_.FixieFun0) FixieFunA(suite.adt.pair.Fixie_.FixieFunA) Method(java.lang.reflect.Method) FixieFun9(suite.adt.pair.Fixie_.FixieFun9) FixieFun8(suite.adt.pair.Fixie_.FixieFun8) FixieFun7(suite.adt.pair.Fixie_.FixieFun7) FixieFun6(suite.adt.pair.Fixie_.FixieFun6) FixieFun1(suite.adt.pair.Fixie_.FixieFun1) FixieFun0(suite.adt.pair.Fixie_.FixieFun0) List(java.util.List) FixieFun5(suite.adt.pair.Fixie_.FixieFun5) FixieFun4(suite.adt.pair.Fixie_.FixieFun4) FixieFun3(suite.adt.pair.Fixie_.FixieFun3) FixieFun2(suite.adt.pair.Fixie_.FixieFun2)

Aggregations

Method (java.lang.reflect.Method)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Objects (java.util.Objects)1 FixieFun0 (suite.adt.pair.Fixie_.FixieFun0)1 FixieFun1 (suite.adt.pair.Fixie_.FixieFun1)1 FixieFun2 (suite.adt.pair.Fixie_.FixieFun2)1 FixieFun3 (suite.adt.pair.Fixie_.FixieFun3)1 FixieFun4 (suite.adt.pair.Fixie_.FixieFun4)1 FixieFun5 (suite.adt.pair.Fixie_.FixieFun5)1 FixieFun6 (suite.adt.pair.Fixie_.FixieFun6)1 FixieFun7 (suite.adt.pair.Fixie_.FixieFun7)1 FixieFun8 (suite.adt.pair.Fixie_.FixieFun8)1 FixieFun9 (suite.adt.pair.Fixie_.FixieFun9)1 FixieFunA (suite.adt.pair.Fixie_.FixieFunA)1 Read (suite.streamlet.Read)1