All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.mapping.ClickHouseArrayMapper Maven / Gradle / Ivy

The newest version!
package org.hibernate.mapping;

import java.util.*;

public class ClickHouseArrayMapper {

    public static String[] getStringArray(Object[] objects) {
        String  [] strings = new String[objects.length];
        for (int i =0; i getOrderedStringSet(Object[] result) {
        LinkedList strings = new LinkedList<>();
        if (result == null) {
            return new LinkedList<>();
        }
        int length = result.length;

        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < length; i++) {
            char letter = (char) ((byte) result[i]);
            if (letter == ',' || letter == ']') {
                strings.add(sb.toString());
                sb = new StringBuilder();
            } else {
                sb.append(letter);
            }

        }

        return strings;
    }

    public static LinkedList getOrderedIntegerSet(Object[] result) {
        LinkedList strings = new LinkedList<>();
        if (result == null) {
            return new LinkedList<>();
        }
        int length = result.length;
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < length; i++) {
            char letter = (char) ((byte) result[i]);
            if (letter == ',' || letter == ']') {
                strings.add(Integer.valueOf(sb.toString()));
                sb = new StringBuilder();
            } else {
                sb.append(letter);
            }
        }
        return strings;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy