package net.ranides.test.mockup.reflection;

import lombok.Builder;
import lombok.Data;
import lombok.Singular;
import net.ranides.assira.text.FormatHex;

import java.util.List;
import java.util.Map;

public class ForObjectWalker {

    public static final Foo FOO1 = Foo.builder()
            .bar(new Bar("456", "0xFAD"))
            .name("John")
            .name("Jenny")
            .name("Adam")
            .point(17, new Point(21,6,4))
            .point(18, new Point(21,6,4))
            .point(3, new Point(9,19,11))
            .point(8, new Point(9,32,2))
            .point(21, new Point(9,7,5))
            .point(88, new Point(21,6,4))
            .build();

    public static final Foo FOO2 = Foo.builder()
            .bar(new Bar("456", "0xFAD"))
            .name("John")
            .name("Jenny")
            .name("Adam")
            .point(17, new Point(21,6,4))
            .point(18, new Point(21,6,4))
            .point(88, new Point(21,6,4))
            .build();

    public static final Foo FOO3 = Foo.builder()
            .bar(new Bar("55", "0xEE"))
            .name("Tom")
            .point(33, new Point(3,3,3))
            .build();

    public static final Foo FOO4 = Foo.builder()
            .bar(new Bar("66", "0x11"))
            .name("Ann")
            .point(77, new Point(7,7,7))
            .build();

    public static final MyRecord MY_RECORD = MyRecord.builder()
            .uid(556)
            .binary(FormatHex.parse("32 56 a0 f3 47 8a"))
            .sequence("hello world".toCharArray())
            .lines("one two three four five six".split(" "))
            .build();

    public static final Quaz QUAZ = Quaz.builder()
            .uid("quaz")
            .numbers(new int[]{1,7,13,9})
            .build();

    @Data
    @Builder
    public static class MyRecord {
        private final int uid;
        private final byte[] binary;
        private final char[] sequence;
        private final String[] lines;
    }

    @Data
    @Builder
    public static class Foo {
        private final Bar bar;
        @Singular
        private final List<String> names;
        private final Bar empty;
        @Singular
        private final Map<Integer, Point> points;
    }

    @Data
    public static class Bar {
        private final String uid;
        private final String hex;
    }

    @Data
    public static class Point {
        private final int x;
        private final int y;
        private final int z;
    }

    @Data
    @Builder
    public static class Quaz {
        private final String uid;
        private final int[] numbers;
    }

}
