package net.ranides.test.mockup.query;

import lombok.RequiredArgsConstructor;
import lombok.experimental.UtilityClass;

@UtilityClass
public class CQueryTypes {

    public interface Text extends CharSequence {

    }

    @RequiredArgsConstructor
    public static class TextValue implements Text {

        public final CharSequence text;

        @Override
        public int length() {
            return text.length();
        }

        @Override
        public char charAt(int index) {
            return text.charAt(index);
        }

        @Override
        public TextValue subSequence(int start, int end) {
            return new TextValue(text.subSequence(start, end));
        }

        @Override
        public String toString() {
            return text.toString();
        }
    }
}
