class Builder {

        /**
         * Utility constructor.
         */
        private Builder() {
        }

        /**
         * Creates new {@link SortArgs} setting {@literal PATTERN}.
         *
         * @param pattern must not be {@code null}.
         * @return new {@link SortArgs} with {@literal PATTERN} set.
         * @see SortArgs#by(String)
         */
        public static SortArgs by(String pattern) {
            return new SortArgs().by(pattern);
        }

        /**
         * Creates new {@link SortArgs} setting {@literal LIMIT}.
         *
         * @param offset
         * @param count
         * @return new {@link SortArgs} with {@literal LIMIT} set.
         * @see SortArgs#limit(long, long)
         */
        public static SortArgs limit(long offset, long count) {
            return new SortArgs().limit(offset, count);
        }

        /**
         * Creates new {@link SortArgs} setting {@literal GET}.
         *
         * @param pattern must not be {@code null}.
         * @return new {@link SortArgs} with {@literal GET} set.
         * @see SortArgs#by(String)
         */
        public static SortArgs get(String pattern) {
            return new SortArgs().get(pattern);
        }

        /**
         * Creates new {@link SortArgs} setting {@literal ASC}.
         *
         * @return new {@link SortArgs} with {@literal ASC} set.
         * @see SortArgs#asc()
         */
        public static SortArgs asc() {
            return new SortArgs().asc();
        }

        /**
         * Creates new {@link SortArgs} setting {@literal DESC}.
         *
         * @return new {@link SortArgs} with {@literal DESC} set.
         * @see SortArgs#desc()
         */
        public static SortArgs desc() {
            return new SortArgs().desc();
        }

        /**
         * Creates new {@link SortArgs} setting {@literal ALPHA}.
         *
         * @return new {@link SortArgs} with {@literal ALPHA} set.
         * @see SortArgs#alpha()
         */
        public static SortArgs alpha() {
            return new SortArgs().alpha();
        }

    }

    /**
     * Sort keys by an external list. Key names are obtained substituting the first occurrence of {@code *} with the actual
     * value of the element in the list.
     *
     * @param pattern key name pattern.
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs by(String pattern) {

        LettuceAssert.notNull(pattern, "Pattern must not be null");

        this.by = pattern;
        return this;
    }

    /**
     * Limit the number of returned elements.
     *
     * @param offset
     * @param count
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs limit(long offset, long count) {
        return limit(Limit.create(offset, count));
    }

    /**
     * Limit the number of returned elements.
     *
     * @param limit must not be {@code null}.
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs limit(Limit limit) {

        LettuceAssert.notNull(limit, "Limit must not be null");

        this.limit = limit;
        return this;
    }

    /**
     * Retrieve external keys during sort. {@literal GET} supports {@code #} and {@code *} wildcards.
     *
     * @param pattern must not be {@code null}.
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs get(String pattern) {

        LettuceAssert.notNull(pattern, "Pattern must not be null");

        if (get == null) {
            get = new ArrayList<>();
        }
        get.add(pattern);
        return this;
    }

    /**
     * Apply numeric sort in ascending order.
     *
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs asc() {
        order = ASC;
        return this;
    }

    /**
     * Apply numeric sort in descending order.
     *
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs desc() {
        order = DESC;
        return this;
    }

    /**
     * Apply lexicographically sort.
     *
     * @return {@code this} {@link SortArgs}.
     */
    public SortArgs alpha() {
        alpha = true;
        return this;
    }

    @Override
    public <K, V> void build(CommandArgs<K, V> args) {<FILL_FUNCTION_BODY>


        if (by != null) {
            args.add(BY);
            args.add(by);
        }

        if (get != null) {
            for (String pattern : get) {
                args.add(GET);
                args.add(pattern);
            }
        }

        if (limit != null && limit.isLimited()) {
            args.add(LIMIT);
            args.add(limit.getOffset());
            args.add(limit.getCount());
        }

        if (order != null) {
            args.add(order);
        }

        if (alpha) {
            args.add(ALPHA);
        }

    
<no_super_class>