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

com.github.leeonky.dal.runtime.inspector.StringInspector Maven / Gradle / Ivy

package com.github.leeonky.dal.runtime.inspector;

import com.github.leeonky.dal.runtime.Data;
import com.github.leeonky.util.Classes;

public class StringInspector implements TypeValueInspector {
    private final Data data;

    public StringInspector(Data data) {
        this.data = data;
    }

    @Override
    public String inspectType() {
        return Classes.getClassName(data.getInstance());
    }

    @Override
    public String inspectValue() {
        return "<" + data.getInstance().toString().replace("\\", "\\\\").replace("\n", "\\n")
                .replace("\r", "\\r").replace("\t", "\\t").replace("\b", "\\b") + ">";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy