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

com.github.davidmoten.odata.client.generator.Indent Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package com.github.davidmoten.odata.client.generator;

public final class Indent {

    public static final String INDENT = "    ";

    private String value;

    public Indent() {
        this("");
    }

    public Indent(String value) {
        this.value = value;
    }

    public Indent left() {
        if (value.length() < INDENT.length()) {
            throw new RuntimeException("left called more than right");
        }
        value = value.substring(0, value.length() - INDENT.length());
        return this;

    }

    public Indent right() {
        value += INDENT;
        return this;
    }

    @Override
    public String toString() {
        return value;
    }

    public Indent copy() {
        return new Indent(value);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy